Russell Beattie slams Java, pushes PHP for web development

Russell Beattie talks up web development in Java and PHP. I know he’s tried Cocoon, so it’s funny seeing him talk about URL abstraction and all sorts of other stuff that Cocoon already has.

He also points out flaws in Java’s APIs:

Ever used the Calendar API? It’s written by a monkey. Ever check out the code under the JSTL? Those guys have to be on crack.

But then he also admits PHP code he’s seen is crappy as well:

I loaded up my first PHP application the other day (dotProject) on a test server and dived into the code, you know what? There’s no secret! The code was ugly and embedded and duplicated and horrible. But it was done, and being maintained and being documented and basic enough so that everyone could understand it.

The last time I checked, the Java API code worked just fine, so with respect to “working”, Java and PHP both work just fine. The problem I have with his argument is that when PHP is concerned, crappy code is acceptable, but if it’s Java, forget it brother, you’re crazy! I can write bad working PHP code and be OK, but if I write bad working Java code, there’s something wrong with that? He’s the crazy one!

Any language can be hard to read. I’ve seen some really really bad PHP code that is impossible to maintain. I’ve seen bad Java code, too. Anybody can overarchitect a program. The fact that Java is more OO than PHP would tend to have people going Object Crazy. Perl’s syntax that allows special magic variables would tend to have people going Magic Variable Crazy, causing more unreadable code. PHP’s syntax which allows code embdedded inside markup lends itself to people who write pages that require a templating system to retain any sort of maintainability.

Code that just works, but is impossible to maintain is the first code to get replaced when someone new comes in. The syntax of Perl also lends itself to using obscure magic shortcuts.

People brawl over which language is the best fit for a job, but I think the argument is worthless, and it’s as timeless as Emacs vs. vi. Use what works best to solve your problem. If it’s Java, use it. If it’s PHP, use it. If it’s Perl, use it, but please be careful ;)

That COMDEX panel was bogus, too. Having Rasmus, who freakin’ invented PHP, attacking Java, while having some random guy (who didn’t invent Java) try to defend it is like shooting fish in a barrel. Completely unfair, but oh well, what are you going to do?

Comments are closed.