A couple of things amused me in the blog that Ovid linked to. Ninh writes
Come to think of it, I find it kind of insulting that PHP thinks you need ugly training wheels like this in the first place. Last time I checked, the world wasn’t filled with scrawny developers that would come crying to their mommies after getting their first facepalm of “AmbiguousInvocationError”.
Um, but isn't he tilting at windmills? I thought that the whole philosophy of PHP was "easy things as easy as possible". Which, if Larry's water bed theory of language design holds, means that something has to give elsewhere.
Meanwhile, as part showing that
:: works just fine in C++ as namespace and package separator, Ninh gives example code and notes
Yes, you’ve read this correctly. Unlike PHP, C++ will simply say that you’re a silly person to write “less-than-intelligent” stuff like this in the first place and thinks it is the responsibility of YOU, the programmer, to solve this problem.
Except, here's how his C++ compiler tells you, the programmer, that you have conflicting
$ c++ -o test test.cpp
/var/tmp//ccCahjBl.s:47:FATAL:Symbol __ZN3Foo3barEv already defined.
Here's what my compiler made of it:
g++ clash.cc -o clash
/var/folders/TZ/TZzOop8WEdSNgET6iqWhPE+++TI/-Tmp-//ccMPeaMa.s:49:FATAL:Symbol __ZN3Foo3barEv already defined.
Yes, such a clear, concise error message, isn't it? Includes the file name and the line number of the conflict, so I can go straight to it in my editor. A best practice that every other language should be following.