PHP Gets Namespace Separators, With a Twist
jeevesbond writes "PHP is finally getting support for namespaces. However, after a couple hours of conversation, the developers picked '\' as the separator, instead of the more popular '::'. Fredrik Holmström points out some problems with this approach. The criteria for selection were ease of typing and parsing, how hard it was to make a typo, IDE compatibility, and the number of characters."
... and comming full circle.
Onda Technology Institute
I couldn\'t read the summary because it had an unterminated string literal.
It'll be /, just to keep things interesting.
[sic]
The World Wide Web is dying. Soon, we shall have only the Internet.
While you're livin' it up at your stately manor, I'm coding PHP out of my garage, you insensitive clod!
The World Wide Web is dying. Soon, we shall have only the Internet.
Just make sure they name it a backslash in the documentation, not a slash.
... to cause for windows servers...
imagine what directories will be deleted due to a typo!
PHP is far from dead. PHP5, with support for real OO, was a huge improvement. There's been a lot of hard work put in to PHP in the last few years to make it a much more viable modern programming language.
Then I see people suggesting \ for a namespace separator, and I wonder what happened to all the people that put so much work into making PHP5 good, and why we can't get them back.
AltGr + Plus [the key right of number 0] on Estonian layout also. This is so discriminatory! :P
We should use a character present on most keyboard layouts. I propose the use of the Space-key for this purpose.
The number of days that an old, crusty Perl developer can laugh at another language are few and far between.
Thank you, PHP.
There are lots of valid reasons for hating any given language, but syntax is rarely one of them. (Lisp excepted)
I am TheRaven on Soylent News
You mean "language\runtime\interpreter\parser\scanner".
Yeah, you don't need insight to know the developers were high as a kite.
When are you going to use the escape character outside of a string? I agree that it's dumb, and it's going to make for ugly looking code, but saying that it shouldn't be used because it's an escape character seems like an empty criticism. It's like saying that Elisabeth Taylor's personal life is messed up because she doesn't pay enough attention to her hair.
I don't do minor upgrades, there are other people for that. When a major upgrade is needed, let's say from version "2.7" to "3.0" they call me.
Wow. So you're the guy that does those small changes huh? They usually call me for "3" to "4". I write it all in machine language for optimized speeds and job protection.
Now do you have to escape your namespaces before passing them through eval?
eval("$instance = new My\\Super\\Class(\"blah\"););
Since they now are using the escape character for namespaces, I wonder what kinds of security implications this might have? What happens when a PHP program for some reason evals() some user input that doesn't properly escape the namespaces?
Since PHP is open source, someone will make a fork with a different separator and the dumber of the two choices will wither away.
It's simple: I demand prosecution for torture.
Never mind. I won't call you.
I understand they messed up parsing foo::bar as one method... so why not just do namespace:::foo::bar ? ::: is still far from standard, but less god awful than "\".
If ::: means something in the PHP universe (I set the language down years ago), then they could do ":.:" and make both C# and Perl programmers happy in one swoop!
in other words you're incapable of maintaining code and you rewrite the same thing for them in a different language...
Yeah, screw those guys! I'll make my own PHP -- with blackjack! and hookers!
Soylent Green is peoplicious!
In fact, not to start a language war, I think his language of choice should be Perl.
Cheers,
alf