PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Matthew Weier O'Phinney's Blog: Why PHP Namespaces Matter

Note: This article was originally published at PHPDeveloper on 5 February 2011.
PHPDeveloper

Matthew Weier O'Phinney has a new post today talking about why namespaces in PHP matter and why he thinks they're a valuable contribution to the language.

You've heard about PHP namespaces by now. Most likely, you've heard about -- and likely participated in -- the bikeshedding surrounding the selection of the namespace separator. Regardless of your thoughts on the namespace separator, or how namespaces may or may not work in other languages, I submit to you several reasons for why I think namespaces in PHP are a positive addition to the language.

He breaks down his reasons into four different categories - the code organization benefits that come with namespace "containers", simplified interface structure, improved readability (no more huge class names) and a simpler method for identifying dependencies