| You make a lot of valid points. I totally agree with you on the (lack of) validity of the Tiobe rankings. However, it is my impression that PHP's popularity seems to be stagnating. I remember noticing a decrease for PHP in another language popularity benchmark recently, but couldn't find that reference anymore. It is really hard to measure language popularity objectively, but as a response to a parent poster claiming PHP is imminently disruptive my opinion remains that language popularity metrics don't support a sudden increase in popularity. If PHP would be on the verge of disrupting something those metrics should be noticeably going up. An interesting metric would be Google Trends[0], which shows a steady decline in search volume for "PHP" while the graph is a lot flatter for e.g. Python[1]. I don't think the number of Github projects for PHP is a great metric, because I think the Github community isn't representative of the typical PHP user, whereas it is virtually part of the DNA of e.g. Rubyists. You're right to say that plenty of good hackers use PHP, but not because they think its a fun language to work with. You make a point out of PHP being the right tool for the job in certain scenarios, but in my experience it seldom is. Others have already made the point that cheap hosting isn't exclusive to PHP (consider e.g. cheap virtual/cloud hosting like AWS and Heroko). I can imagine using PHP for quick <10 line hacks when convenient[2] or to maintain legacy code and customize open source applications like Wordpress. Rewriting every line of code in existence using the popular language du jour simply isn't realistic. However, that doesn't make PHP the right tool for the job for fresh, non-trivial projects. You're also right that good developers who happen to write PHP tend to get paid well. My point, however, is that there is a lot of cheap labor available that is able to write PHP (most of whom aren't good developers). This makes it a great fit for those customers that like to pay minimum wage for software development. I understand your frustration about people bashing PHP, because in a way it is a silly example of elitism in this community to look down on PHP and its community. However, while I at least try to remain somewhat reasonable about it, my tone in regard to PHP is based on a long list of negative experiences that are presumably shared by a lot of people on HN. [0]: http://www.google.com/trends?q=php [1]: http://www.google.com/trends?q=python [2]: In fact, I recently wrote a <?php print_r($_POST); ?>
deployed on my Macbook's Apache server to quickly test some Clojure code making HTTP POST requests. |
The next step seems to be to disrupt Java enterprise webapps. Although that may not be exciting to a mainstream programmer, it would still be a disruption, and typical of how disruptions move upmarket, tier by tier.
fmw and bad_user have noted many important aspects of PHP, but I was really just thinking of its core idea: templates. PHP didn't originate them (eg bash does it echo hello $name; C has printf; etc), but it's taken it to the logical extreme of a program being a template, and it's the most popular embodiment (I think coldfusion and others did it too, but less successfully).
I think templates are a great idea, because they are simple and concrete. Abstraction and other meta features are powerful; but if the job doesn't need them, they only obscure what you are trying to do.
While surprisingly versatile (e.g. TXL does language translation with them), templates are limited as a general programming concept - and so PHP is probably similarly limited, perhaps to just the web (maybe it could expand to desktop applications, since they increasing use HTML for UIs - though deskapps are seemly being disrupted themselves by webapps). But it's hard to seriously entertain a fps in PHP; a compiler (though consider TXL...); a VM; a RDB; mathematica; pagerank implementation; numerical simulation; an OS.
Meanwhile, the template "technology" is accessible from other languages: python, ruby, java etc all have a broad choice of templating engines for webpage generation. So it is arguable that the technology of templating has been co-opted by the mainstream - although, PHP remains the simplest one. When the job is simplest enough, it seems PHP will win, simply because it can do the job, and it is accessible to more people.
BTW: the factors others have mentioned are also important (low cost hosting, labour etc) - though some of them can be traced to the simplicity and concreteness of templates (which made webapp creation possible for people with less skill).
I have to admit, I am a huge fan of template "technology". I think it is a brilliantly insightful and simplifying idea. They can also be seen as productions in a CFG.