4 ms·
PHP doesn't attract smart people that want to use it for fun in the same way that Java doesn't. Sure, the HipHop work that engineers at Facebook are responsible
by fmw 15y ago
PHP doesn't attract smart people that want to use it for fun in the same way that Java doesn't. Sure, the HipHop work that engineers at Facebook are responsible for must be fun to hack on and the same goes for some of the things that are happening at Google and Twitter with Java, but the base of the PHP community is working on mediocre crap. Beyond these exceptions that prove the rule I can't imagine any good hackers using PHP for fun. Some might write PHP code as a day job, but will play with more enjoyable languages at night. Most just give up on the language entirely and move on to greener pastures.
It is clear why hackers get frustrated with the language. It is inconsistent and extremely tricky if you want to write secure code. The core developers are mostly concerned with endless discussions about adding buzzword compliant features that don't add any real value (Zend seems to be obsessed with being a poor man's Java so they can sell their ecosystem to "the enterprise"). Also, the community is pretty mediocre with an awful noise vs signal ratio.
So if hackers don't use PHP, who does? Clearly, PHP is very successful with people that want to tweak open source applications like Wordpress and aspiring developers or non-technical people that want something accessible that runs everywhere. Also, PHP developers tend to be cheap labor. There are plenty of them around, including in low cost outsourcing centers, that will charge you a lot less than more competent developers would. So it seems ideal to non-technical businesses looking for a cheap way to add some dynamic features to their website. Thankfully for PHP this group is a lot larger than the hacker community, so the language won't go away any time soon. Especially if you consider the fact that a lot of hackers learn their trade by writing little PHP scripts and customizing open source applications like Wordpress before moving on to something more interesting (I have to admit PHP was my first web scripting language too, back in 2000, but I quickly moved on to Python and now Clojure).
Is this disruption waiting to happen? I don't know. In fact, PHP seems to be trending downwards[0] as the generation that picked up the language before frameworks like Rails and Django were available is switching to the current languages du jour. If anything, it is not the language that is causing disruption, but applications like Wordpress that are easily accessible to non-technical people. However, hosted/SaaS alternatives like Posterous seem to be disrupting the whole idea of non-technical people installing Wordpress (at least I hope so[1]).
[0]: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html http://www.tiobe.com/index.php/content/paperinfo/tpci/index....
[1]: The main reason I might sound bitter about PHP is having to extinguish fires caused by idiots who write insecure PHP scripts or install open source scripts without bothering to periodically apply security fixes to counter the constant streams of exploits in said open source code while being responsible for some virtual hosting servers several years ago.
- bad_user 15y agoI think "hacker" is an overused term. There are really good hackers out there for which tools are chosen based on suitability for the tasks themselves, and if for example cheap hosting is what you're looking for, then PHP is one of the best options. PHP developers tend to be cheap labor I also hate the term "X developer". I never labeled myself as a Python-developer, or a Java-developer -- I'm just a developer that happened to learn whatever was necessary. Good developers are getting properly paid, regardless of the tools they put on their resume. Tiobe is also an extremely poor reference for language popularity, btw. That said, last time I used PHP was 5 years ago simply because it isn't suited for the kind of work I do. Now I work with Python a lot, and with Ruby on the side -- because Python has mature libraries for visualization / parsing / data-mining, it has bindings for every meaningful C library under the sun, and because Python can be made to scale painlessly by means of non-blocking I/O or other tricks (as it's really mature in that regard). I also like Ruby because its community is something to marvel at -- I never seen so much (focused) activity / cooperation and so much work done in so little time. That's the problem with PHP -- technically, it's just an Apache plugin, done as a quick hack, reflecting in the available libraries / the community's culture, and there's no way it can escape it. To make a bad joke -- you can pull PHP out of Apache, but you can't pull Apache out of PHP.
- fmw 15y agoYou 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 http://www.google.com/trends?q=php [1]: http://www.google.com/trends?q=python 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.