Venting PHP frustration
by Josh Staiger
"By induction, the only programmers in a position to see all the differences in power between the various languages are those who understand the most powerful one. (This is probably what Eric Raymond meant about Lisp making you a better programmer.) You can't trust the opinions of the others, because of the Blub paradox: they're satisfied with whatever language they happen to use, because it dictates the way they think about programs."
-- Paul Graham, Beating the Averages
I'm currently pulling my hair out trying to write a web application in PHP. How do people get anything done in PHP? It doesn't have a toplevel. It doesn't support closures, packaging, method specialization, keyword parameters, or macros (!). I'm not even being strictly facetious here. Over the course of writing this app, at different times I've seen a need for each one of these features and have had to work around the lack of them in a less elegant fashion.
How retarded is it that the + operator doesn't actually concatenate two arrays, but instead does index-value replacement?
The only thing that PHP really offers is the built-in html templating system, but even this gets to be terribly convoluted due to the lack of an easy way to substitute expression values in your template, forcing you to sprinkle <? echo ... ?> tags throughout (which is awkward in the context of html attributes).
I wrote a mid-sized application in PHP around three years ago, and even at that time (as unenlightened as I was), I still remembered being somewhat frustrated by the lack of many full-blown Perl features.
I was hoping that things would have improved somewhat by now, but apparently I was wrong.
Whatever possessed people to to use this language over Perl? How the fuck did it get to be so popular?
I'm tempted to scrap all the code I've written so far and rewrite in Ruby.