[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0

WordPress Trac noreply at wordpress.org
Tue Dec 7 01:00:59 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 hellofromTonya):

 Somehow this ticket became a software principles discussion.

 [#comment:26 Quoting @azaozz]:
 >namespaces should be considered "evil" in open source software and
 avoided as much as possible

 I've had couple of contributors reach out to me privately in slack asking
 why this statement was made. I'll share my comments to provide balance to
 opinions already shared.


 * is common practice across many programming languages including
 JavaScript, PHP, Python, C#, etc.
 * is common practice in open source projects including PHPMailer (already
 embedded in Core), WooCommerce, WP-CLI, Drupal, Joomla, Laravel, Symfony,
 BigCommerce, Composer, PHPUnit, etc.
 * is not a replacement for bad naming, quite the contrary.
 * works well for functions, classes, traits, interfaces, etc.

 In my opinion:
 * It's not evil.
 * Yes, naming stuff is hard. It's always been hard and I've seen folks
 struggle to name things throughout my 35 years in engineering.

 [#comment:34 Quoting @azaozz]:
 >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.

 I want to point out that actually WordPress ''could add namespaces'' if a
 BC-layer is also created (could follow Requests 2.0.0 example).

 WordPress is not limited or held back from adding namespaces. Actually,
 they already exist in Core with the external SimplePie library.

 For Core's existing code, decisions would need to be made about where it
 makes sense to use it. For new code, it could be added if the coding
 standards allowed it.

 If there's interest in introducing namespacing into Core beyond external
 libraries like SimplePie and Requests, then that discussion deserves its
 own ticket.

Ticket URL: <https://core.trac.wordpress.org/ticket/54504#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list