Tony Cowderoy wrote:
PHP and Perl don't scale up (i.e. to one very big server) as well as Java does, because the popular Java-based servers and JVMs have been very carefully optimised to scale up well. This fits traditional corporate thinking, which is one big box because that is often cheaper and easier to manage than a lot of little ones (but harder to scale quickly). As a result, Java solutions tend to look like resource hogs when implemented on a small scale. They use a lot of resources just to load, but don't need all that much more to handle a lot of users and high transaction rates.
That can just be another way of saying (and I don't know if that's the case here) that the per-client load is negligible compared with the overhead. Do you have any stats for how many simultaneous clients any given server can support for either Perl, PHP or Java? My guess would be that in most cases the database is the limiting factor, although it is only a guess. My only indirect experience of PHP vs Java was when a major site moved from the former to the latter due to an imposed corporate standard. Of-course the devs were all PHP proficient and had to learn something new, but even a couple of years later they still feel it was the wrong move (primarily that it takes longer to deliver in Java than PHP). Of-course there will be many counter examples, and I have no direct experience of Java to compare with (but at least client side I think I'm about to start getting some).
1) fashion - it is now perceived as the safe option, which is important if your job and your boss's job depend on it. You're unlikely to get fired for choosing Java. In the eyes of a lot of corporate IT people, there are only two options - Microsoft or Java;
I don't see this. We see far more call for PHP (and I can't think when someone last seriously proposed ASP for a job). Maybe I don't move much in the corporate world :-) We usually define jobs in terms of the deliverables not the technology anyway.
2) there are now a lot of moderately competent Java programmers out there at reasonable salaries;
This is a good point; there's probably far fewer incompetent Java programmers than there are for PHP (simply because the latter is easier to get in to). In this respect PHP is a bit like HTML - almost anyone these days has got something they can say about PHP on their CV.
5) the popular Java-based web servers are designed to allow you to switch application modules in and out, and to reconfigure individual applications without a restart.
I'm not sure really what you're saying here? Whilst something like Apache will require a "restart" when its config changes, its a zero-downtime restart; old connections complete normally, new ones are made to a new process running with the new config. Once the old threads have finished dealing with clients they stop taking new ones and very quickly (usually <1sec) you're running on the new config. Unless your new config is broken, of-course :-) But there are plenty of ways to check that first.
6) at the risk of starting a flame war, Java's OOP and modularisation facilities are, arguably, much more rigorous than Perl or PHP.
I can't see why anyone would argue with that! (At least not on the OOP point; I'm not really sure how you're defining modularisation.) We might argue about how important it is, however...
Both Perl and PHP have a reputation for becoming difficult to use on very large projects - that's large in terms of functionality, not transaction rates or data volumes.
In large part this is due to a point I made above; there's a lot of relatively poor PHP devs out there. I have looked at several well established apps in the past and the quality of code in them is not great. (The same is true of other languages, of-course.) The number of times I see constructs like $var1 = "$var2" is amazing. (To the non-PHP programmers: it's equivalent to $var1 = $var2, since variables inside double quotes are expanded, but its usage is a pretty good indication that the user is not sure of the language they're working in, having settled for something that works rather than something they understand.)
Many of the very popular web sites are not all that complex in terms of functionality. When your applications run to millions of lines of code and there are dozens of programmers in the development team, strong encapsulation becomes very important - otherwise you run into major problems with namespace conflicts. I don't know much about PHP's OO architecture, but Perl's is notorious for this.
PHP's OOP (at least to version 4, v5 is much "better") is weak here, but there are other mechanisms to achieve the same goals. PHP's weak OO structure was by design; OOP is expensive in processing power, particularly in a scripted language. As processing power has increased the use of OOP in PHP has increased accordingly. The key here is (I suspect?) that in PHP it's much easier to program badly than it is in Java. You can (and should) program well in both, but Java makes more effort to enforce it. For simple jobs that can be a pain where you just want to write a quick hack, but bigger applications should not be treated that way. PHP and Java come from opposite ends of the spectrum and in the middle ground they're both as good as each other. I suspect that something which started nearer the middle (Python?) is probably better there still, but I have no experience of it. In nay case I would thoroughly recommend that any developer use more than one language. Skills you learn in one almost always carry forward to the others. -- Mark Rogers More Solutions Ltd :: 0845 45 89 555 _______________________________________________ Peterboro mailing list [email protected] http://mailman.lug.org.uk/mailman/listinfo/peterboro
