Finally namespaces

There’s a lot of whining whining about the new namespace separator these days. Not only on blogs. At first I was a bit negative towards the choice but is more and more convinced it is a good one.

First of all, few of the people complaining seem to have read the RFC documents explaining in detail the pros and cons of different choices. So here goes, read carefully before deciding.

To be honest. If some of the other suggestions in the RFC “Namespace separators” above would have won I think a lot more people would have had better reasons to rant. The backspace “\” is probably the most readable choice and thus less prone to typos which is a Good ThingTM.

Most of the criticism seem to stem from the problems you could get from having namespaces in strings and that backslash is used for escaping. I am a unix based developer but I guess that to developers using windows this is a no brainer. They’re already used to have a backslash in another context. If you then have a look at the way many projects, including for example Zend Framework, organize their classes and what should be namespaces into directories it makes sense to a lot of people.

So it’s not all bad. I’m looking forward to not having to instantiate insanely named classes like

$upload = new Zend_File_Transfer_Adapter_Http();
PHP

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

6 Responses to “Finally namespaces”

Trackbacks

Check out what others are saying about this post...
  1. [...] Danne has the stuff, but I can tell that backslash is the buzz! [...]



Leave Comment

(required)

(required)