I think “Pizza” and I have always disagreed on this.
First let me start with “Pizza” the author of “Parseerror.com” is a friend of mine and I think we have always disagreed on how harsh to be in reference to “php” as a programming language. I will jump at the chance to comment on an entry I found on his site though, which I have quoted below:
I’d realized years ago how horrible of a language php is. But amazingly, php just gets worse. For example, they manage to easily temper the good news of the addition of long-overdue namespaces with the ludicrous use of the ‘\’ character to separate them, when every other language in the Universe uses ‘.’ (This.Makes.Perfect.Sense vs. What\Were\They\Thinking). Today a member of #php ran across another horrific misfeature; a reasonable attempt at string concatenation from a newbie programmer:
"a" + "b"
This code works well in java, javascript, C# and other languages, resulting in a string “ab”. but in php it does the worst possible thing:
var_dump("a" + "b"); int(0)
It happily converts the two strings into integer 0 and adds them, destroying all data in the non-numeric strings with no warnings whatsoever. This is particularly painful because the + operator is a common string concatenator in other languages.
Let me say, to a degree… I agree. It seems silly at best that “a” + “b” does not convert as expected; BUT… for a php developer the result is expected, as this is a known action of php. In most cases when developing code for php developers I assume are not concerned if the developed code would work directly in java, javascript, C# and or other languages, save those that are developing for a multi-platform, multi-language architecture, in which case …. why are you using php to begin with.
From a pure code aspect I would tend to agree that the functionality mentioned above should produce universal results as one would expect. I do not think that we are striving to build a universal language for development in any of these languages that we have mentioned though. I do agree with common practice to keep singularity between languages, but would not go so far as to say that it’s a reason to label php as a “horrible language” because it deviates in this manner, when there are so many better examples to label it with this tag.
On a side note….. “Hi Ryan”
13 May 2009 vMonkey