News for hackers. Stuff that matters.
Re:A Crash-Course in PHP Namespaces for WordPress Developers by firefoxd on Monday May 07, 2018 @03:31PM (#17015718)
The WordPress ecosystem is the one place we need this the most. Adding a plug-in to your wp instance is always a gamble because you know it's gonna break something else.

Kudos to the author for helping solve a real problem.

Re:A Crash-Course in PHP Namespaces for WordPress Developers by jstewartmobile on Monday May 07, 2018 @04:28PM (#17016225)
Namespaces are more like a mitigation than a solution.

The problem is tight-coupling. Until that is addressed, plugins will always be little fail-bombs.

Re:A Crash-Course in PHP Namespaces for WordPress Developers by acobster on Monday May 07, 2018 @06:17PM (#17016930)
There's more than one big problem with WordPress, and namespacing is one of them. It's way too common, even in some of the most popular plugins, to just toss plugins into the global namespace and prefix them with $your_plugin_abbrev_. I've had textbook cases of namespace collision take down sites on routine plugin updates before.

The core design of WordPress relies on global state, e.g. the $post global. I agree that that's a huge issue. Unfortunately, that will never be fixed, because it's so central to the design that "refactoring" the WP core not to use global state would break almost every plugin and every theme, and would be a fundamentally different system.

Re:A Crash-Course in PHP Namespaces for WordPress Developers by debacle on Monday May 07, 2018 @04:47PM (#17016356)
It depends on the plugin. Some of these methods are just helper functions for template rendering. Loose coupling isn't going to contribute a ton there, but not polluting the global namespace is important regardless of coupling.
Re:A Crash-Course in PHP Namespaces for WordPress Developers by jstewartmobile on Monday May 07, 2018 @05:04PM (#17016483)
Write enough code, and you will know that "just" is a famous last word.

An actor model approach where one failure doesn't compromise the entire chain would help, but that is hard.