To read all comments associated with this story, please click here.
The problem is that the convention does not fit within PHP. In PHP, backslash has always meant escape character, as it does in many other C-like languages. To separate components of objects and such, you always use either :: or ->. This is also the convention in other languages. So when it's time to choose the separator for namespaces, the PHP developers, as usual, go and pick the one WRONG way to do it and go with the backslash, which makes no sense in any convention and looks ugly to boot (Windows is the only OS which stupidly uses backslashes as path separators anyways, that's hardly a system I'd want to follow).
There's a reason people badmouth PHP. Actually, a lot of reasons. The developers consistently eschew solid design and convention in favor of a series of "how can we do this least correctly" decisions. I develop with PHP all day. And every day, I run into the stupidity just trying to do basic things. Every day, I have to go read parts of the manual over again to remember which random ordering of arguments I should use for a given string function. Every day I deal with strange inconsistencies in the language, poor OO implementation and performance issues.
Then why use it? Lot's of other languages out there.
That's a rhetorical question by the way. I know why most people use PHP professionally. To make money and because a lot of web programming is now done in PHP. I'm sure lot's of other reasons exist as well.
What amazes me most is how many people dislike PHP (according to forum post and not statistics) yet program with it everyday. I use PHP (drupal fan), but I'm by no means an expert or anything like that.
Oddly I seem to read a lot of bad things about every language. Seems no language is satisfactory. Everybody wonders what those silly language developers were thinking when they did that stupid crap.
For the record. I think the PHP developers could have come up with something a little more elegant than a backslash, but honestly those who program in PHP daily will get use to it. Like it or not. Every programmer I know worth his weight gets use to the quarks of the language they use most. Sure they bitch about it for awhile, but in the end it's just another moot point.






Member since:
2006-02-06
It never ceases to amaze me that every time there's a PHP article on OS news, a bunch of people come into the thread who clearly don't like PHP, with the sole intention of bad mouthing it rather than contributing to any useful conversation. It would be nice, if just for once, people stayed on topic.
At first I thought the back slash was a bit ugly, but really it's no different from what some file systems use to separate levels of folders.
Folder\File
Namespace\Function
I think we just need to get used to it.