I had a conversation with a co-worker last night, who was trying to convince me that Java, unlike PHP, is always gaining in popularity, so should be used instead.
Luckily, I’m not a person who believes everything that I’m told, no matter how convincingly, so I decided to go looking.
The most recognised index for this kind of thing is the Tiobe Programming Community index (the TPC). here
According to that, Java is, indeed the most popular language, but it is in-fact losing popularity, while PHP is in-fact gaining.
From a numbers point of view, Java has dropped from 26% in 2001 to 21% in 2008, while PHP has gained from 2.4% to 9.89% – more than 4 times as popular as it was in 2001!
And so, I think I’ll stay with PHP. I personally believe Java is only useful if you are working in an already Java environment – otherwise, you are just hurting yourself.
On another note in the Java vs PHP game – we wrote an application a while back in both PHP and Java, and it turned out that the Java was faster. However, the PHP was written in MVC using the Zend Framework. It is well known that ZF is slow (particularly if you use Zend_Loader), so this was not really a fair comparison.