PHP Gets Namespace Separators, With a Twist 523
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."
Going back to DOS style... (Score:5, Funny)
... and comming full circle.
Can\'t read summary (Score:5, Funny)
But in PHP for Windows (Score:5, Funny)
It'll be /, just to keep things interesting.
Re:what wrong with (Score:3, Funny)
[sic]
Re:Going back to DOS style... (Score:5, Funny)
Jeez, take a joke as it is, will you?
Re:A long overdue addition (Score:5, Funny)
While you're livin' it up at your stately manor, I'm coding PHP out of my garage, you insensitive clod!
Backslash! (Score:4, Funny)
Well now we all know what trouble this is going .. (Score:5, Funny)
... to cause for windows servers...
imagine what directories will be deleted due to a typo!
Re:The BASIC of the 21st century (Score:5, Funny)
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.
Re:yet another wtf (Score:2, Funny)
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.
Today is a Wonderful Day (Score:5, Funny)
Thank you, PHP.
Re:Well, That Does It! (Score:2, Funny)
Re:Well, That Does It! (Score:1, Funny)
Re:But in PHP for Windows (Score:1, Funny)
I thought they chose \ to make windows users feel like at home..
Re:HOLY FUCKING SHIT!?!?! (Score:2, Funny)
Re:WTF? (Score:3, Funny)
Re:The BASIC of the 21st century (Score:2, Funny)
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.
What about Eval? (Score:4, Funny)
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?
Easy to fix this (Score:5, Funny)
Since PHP is open source, someone will make a fork with a different separator and the dumber of the two choices will wither away.
Re:Going back to DOS style... (Score:3, Funny)
Scroll your screen to see the animation:
\
-
/
|
Re:Easier on which keyboard layout? (Score:1, Funny)
Never mind. I won't call you.
Re:HOLY FUCKING SHIT!?!?! (Score:1, Funny)
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!
Re:The BASIC of the 21st century (Score:4, Funny)
in other words you're incapable of maintaining code and you rewrite the same thing for them in a different language...
Oblig. Bender (Score:3, Funny)
Yeah, screw those guys! I'll make my own PHP -- with blackjack! and hookers!
Re:PHP sucks, but it has a very important niche (Score:2, Funny)
In fact, not to start a language war, I think his language of choice should be Perl.
Cheers,
alf