[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0
WordPress Trac
noreply at wordpress.org
Mon Dec 6 23:59:34 UTC 2021
#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
Reporter: jrf | Owner:
| SergeyBiryukov
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 6.0
Component: External Libraries | Version:
Severity: normal | Resolution:
Keywords: php80 php81 has-patch has-unit- | Focuses:
tests early early-like-actually-early |
-------------------------------------------------+-------------------------
Comment (by azaozz):
Replying to [comment:33 costdev]:
> I'm not sure if this is the right place...
I'm pretty sure it is not. But as you started it, I'll have to answer your
questions :)
I'll be happy to continue this conversation somewhere else at a later
time.
> In terms of going against best practice, that really comes down to a
more general issue. You can write poorly self-documenting code with or
without namespaces, or you can write well self-documenting code with or
without namespaces.
Right, you can. However having a guarantee that your function or class
name will "never" collide with anything is not a good "incentive" to try
to come up with a good name. On the opposite, I've been hearing from many
people over many years that one of the hardest part of coding is ...
picking good descriptive names. My experience over the last 25 or so years
is the same :)
> the contemporary standard is to namespace, and that's true across
multiple languages.
Yeah, namespacing seems to be used more and more (probably because you can
easily pick repeating names with it, lol). It doesn't mean it is a good
idea in all cases. It seems to be more useful/accepted in a "pure" OOP
software (which is most of it), however WP is not OOP by a long shot.
Namespacing for "mostly functions" doesn't seem to work that well.
> Best practice for the survival of open source software has ''always''
been to respect:
Yes, you're right. However thinking this is getting very "philosophical".
Whether recommending or not recommending one (mostly insignificant)
feature does not affect any of it imho. It is just a recommendation after
all.
On the other hand WP will never be able to implement namespacing to most
of the PHP code as it will break it pretty badly. So having some parts
with namespaces while most of the code is without is somewhat.... not that
good? :)
> Joomla, Drupal, etc. implement namespacing, as do most other similar
open source software projects. While we are not those projects, we have a
much larger reach and therefore rely even more heavily on a strong
contributor base. Namespaces are only one contemporary standard, but
dropping them sets a precedent for dropping other contemporary standards
and in turn, threatens the size of our contributor base.
Not talking about dropping, but pretty much all of the current WP PHP code
cannot be namespaced (technically not viable). On top of that namespaces
do not promote better names. There can be requirements to "ignore" the
namespacing and still try to give good, descriptive, unique names to all
functions, but eventually these will be avoided or diminish in importance
because that's one of the main features of namespacing: to let you get
avay with repeating names :)
> In any case, the topic of namespacing within Requests was discussed
publicly...
That may be but it seems problematic to develop a library as part of
WordPress and not take under consideration the established best practices
and requirements for WordPress, whether that was discussed somewhere or
not. Frankly this is the first time I'm hearing about it and I'm pretty
sure it's the same for many other committers.
So in a hindsight: if namespaces cannot be added to WordPress is it a good
idea to add them to a WordPress library? Perhaps it is but it would need
(at least) a good standard of what function and class names are acceptable
and what are not. And all of the community should be aware of it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54504#comment:34>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list