Archive - Originally posted on "The Horse's Mouth" - 2004-11-20 08:52:21 - Graham Ellis
Question to me yesterday: "Do you have a chart that compares the strengths and weaknesses of the various languages that you teach ...." to which I had to answer "Sorry, no". That's partly because it's like trying to compare apples and oranges, and partly because there are so many different scenarios and ifs and buts that it would be pretty tough to come up with a definitive and easy to follow document. But what I [i]can[/i] do is offer a number of insites, snippets, pieces of evidence that will help provide pointers.
For example:
I saw a demonstration yesterday of a web site, running on two browser windows on the same computer. The two windows looked identical, but were pointed to different test servers. One was pointing to a version of an application written in Java, and the other to a version written in PHP.
The gent running the demonstration clicked on a link on the Java version, moved to the PHP version, and clicked on the same link on that window. The PHP version can back to him (and completely redrew the window) before the Java version had even started. Upon questioning, I learnt that both servers were test machines that were very lightly loaded indeed, that the link ran some fairly compute-intensive code, and that the Java server was a higher spec machine than the PHP server. Their own benchmarks (run more scientifically) showed a 3:1 improvement in performance when switched from Java to PHP.
Conclusion: That you 're likely to need more compute power if you're going to write your application in Java rather than in PHP.
Conclusion about the language to choose: No definitive conclusion. For some projects (such as those with a large number of junior staff involved in a relatively secure big system development), Java may be a strong contender. But don't rule out PHP for some of the "traditionally Java" roles - especially with the private, protected, abstract, interface and final enhancements added at PHP 5 which allow for enforcement of encapsulation. Object Oriented PHP has really come of age in version 5 - and we're seeing a much more rapid update for applications that run on dedicated servers that I would have dared forecast.