On Java

Warning, serious parody ahead...

I should really buckle down and try writing a Java app because, at the moment, I have an attitude problem. I know that IBM now officially loves it, and Tim Bray's been charting the upcurve in Java book sales, and everyone's saying that Oracle's going to adopt NetBeans. If you want your ears bent back, have a listen to Sun President Jonathan Schwartz; he'll tell you that half the websites in the world are powered by Java and that there are 2½ million developers and that the war is over and Java won. So here's my problem, based on my limited experience with Java (deploying a couple of Content Management Systems for a big IT company): all the Java code I've seen in that experience has been messy, unmaintainable crap. Spaghetti SQL wrapped in spaghetti JSP wrapped in spaghetti HTML, replicated in slightly-varying form in dozens of places. Everyone agrees on Java's downsides: it's not written for the web, it's difficult to deploy and get running, and it's pretty slow and a resource hog. Those are important disadvantages. And I'm sure that it's possible to write clean, comprehensible, maintainable, Java; only apparently it's real easy not to. But Java has competition, most obviously PHP; and don't write the Rails crowd off, they're not stupid at all and they're trying to learn the lessons that Java tried to teach. So Java hasn't earned everyone's respect in getting where it is, and Sun should understand it more than it has. But in the big picture, it feels vulnerable to me.

Sorry Tim, but when I read your post on PHP, I just couldn't help but swap PHP with Java in there, because that's pretty much my attitude problem with Java! Of course it's a parody of your post, but an alarming amount of the above is actually true in my book!

In the past height years, while running my company web platform, I've eliminated two major things: Microsoft and Java, the two over which I've lost sleep. The big winner is LAMP with P as in PHP, Python and Perl. The new kid on the block is Ruby on Rails, though I'm watching its hosting aspects like milk on the fire, for some of them remind me too much of Java in terms of bad code, memory leaks and resources consumption. I'm not enamored with Linux (especially not the Red Hat distro), and I'm eager to test this T2000 and Solaris 10 to see if they're up to some promises, so Sun's not completely out of the picture (my last Sun server, running Solaris 8, died last year). But in the near future, I'll have no Java on my web servers as long as I have better choices. Better meaning: more reliable, faster and less expensive to write, maintain, deploy and run.

P.S. Tim Bray has picked up a lot of good feedback and reflected it on his post. He labelled mine "satirical, funny", which is cool. I think I need to make clear that the above was written in the same spirit (or so I think) that Tim's piece, i.e. an admitted prejudice, certainly not an absolute truth, that's biased by one's experience. I'm very focused on hosting, i.e. running, dynamic sites in a shared environment where 1) I don't control what my "clients" upload and run on servers, 2) I must ensure everything runs smoothly 365/24/7 style, 3) costs must stay as low as possible (read: pack servers and make them sweat). I know how to do that with PHP, but not with Java. I don't pretend to know it all, but look around at the shared hosting world: how many do offer PHP vs Java at competitive prices? QED. One dirty truth is that one can write good or bad code in just any language, PHP is just more forgiving (or, er, "adapted") to that than Java in a shared hosting configuration with, say, average code from multiple developers that are, say, disparate in quality...

6 Comments

Fair enough, point taken:-)
Thanks for making me laugh.

P@

"Those are important disadvantages." :-)

Can you elaborate on your issues with Linux, and Red Hat specifically? We're thinking of migrating a few of our apps to RHEL from BSD and Solaris. Thanks.

Hi David, please take into account that this was posted two years and a half ago. I've not used any Red Hat distro in the past three or four years, and I stopped using them because, well, their paid-for support really wasn't worth it. I've been happier since with Ubuntu for Linux, or OpenSolaris (Solaris 11 Zones specifically). Your mileage may vary, and the choice depends entirely on how you value paying support for a Linux distro either to the distributor or to your hosting provider. I personally think it's better to get support from the hosting team and let them manage the distro they're more familiar with.

You may want to read what Don MacAskill has written about Red Hat and commercial Linux. As well as this article on competitors.

Funny but wrong.

Java as a language blows, but as a platform it is solid and extremely fast.

People who complain about something being slow are usually using 10 year old fact as if they are fact today and/or have no real definition of slow and don't understand performance issues.

Protip: If the round trip network latency is 400ms and it takes your browser 500ms to render the page it does not matter if the page was generated on the server in 1 nanosecond or 100 ms.

In other words, performance data without context is meaningless.

You obviously missed the third word of the first sentence, as well as skipped following the first link on this post (as in "don't take this, or yourself, too seriously" ;-).

mensuelles Archives

Recent Entries

  • Steve Jobs

    "Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because...

  • Your privacy on MOTOBLUR by Motorola

    After the Nokia Ovi Store carelessness, it's now Motorola who's allowing strangers to get access to your private information on their MOTOBLUR portal. Exactly like...

  • How to resume a broken ADC download

    (I'm documenting this trick for myself to remember, but it can be useful for others…) Apple, on its Apple Developer Connection site, has a bad...

  • WTF is this ‘myEventWatcherDiv’ doing in my web?

    All of a sudden I started to find the following line in most of the web pages I was browsing, including ones I made where...

  • Your privacy on Nokia Ovi Store

    My friend Adam Greenfield recently complained about the over-engineering culture at Nokia: I was given an NFC phone, and told to tap it against the...