Wednesday, June 10, 2009

Is Java Dead?

Recently, on a local Java User Group the question was asked, should Java be my platform of choice. I was fairly surprised by the discussion that ensued. It was largely negative.

And why shouldn't it be, a language that is more than 10 years old, still hampered by its legacy, competing with cutting edge dynamic/scripting languages which seemed to have stolen a great deal of java's positivity. Java was debunked for being inelegant, hard to understand, unpredictable and old fashioned. While languages like Python were praised for their elegance, obviously better than java, far easier to learn and use.

So the question is, is Java that bad?

One or two examples were presented singling out auto boxing as a disaster, concurrency unpredictability and that perennial source of mirth, the try/catch/finally what exception is thrown? Personally, those "what happens in the above piece of code that you'll never write yourself?" are a waste of time. People single out the handful of confusing scenarios that you'll just not get in every day coding (unless you go looking).

The question is, what made java so attractive in the first place? and can those properties carry it forward? It had built in OO (yes, not _everything_ is an object I know, but close enough), it was simple, had none of the superfluous syntactic sugar of C++ and hit the ground running with a useful API, both for gui and other development and it was cross platform (ran on a VM).

The factor that is very often underestimated in proclaiming java's looming demise in face of more modern, dynamic and scripting languages is that only a small minority of developers actually keep up to date. Some have said, it's in the region of 20%, in my experience, it's probably about 15%. Those are the ones that don't teach themselves new technologies unless forced to. Also, I doubt those individuals see the pitfalls of java - the so called inelegance, is to my mind, significantly overblown. Yes, autoboxing has problems, but I've already seen the benefits of it, which outweigh the problems.

It would be remiss of me not to indicate that without the java platform, java would not be as viable as it is. In fact, some would say that without that java would be on the wain, and possibly "dead". One thing is for sure, that this is what makes java so viable and the only choice for any project of significant size and scale.

Personally, I cannot see java fading away or even losing it's dominant position in the market in the next 10 years. In ten years time, things will largely be the same as they are now. The new kids on the block however, will grow and will start to cut into java's domination, especially on the web and on the desktop, though I do think that google is going to keep java strong on the web (gwt and google app engine). Java will lose in these areas, but in it's mainstay, on the enterprise, it's not going anywhere.

1 comment:

Peter said...

When it comes to enterprise systems, I don't think there is any platform as mature and stable and well-known as Java. People have been building successful systems on it for years, and now suddenly it's not a good choice for building a system?

I can understand it not being cool. That's a given, it's old and bloated, it's not young and hip any more. But when someone is discussing what they should use for a critical business system, hip and cool should not come in to the picture as much as stable, tried-and-tested and possible-to-find-developers-for.

Obviously some teams are going to be ready for Rails, or have already implemented a few small systems using it and are ready to deploy it in a big app, but the majority, the vast majority, are more suited to a platform that doesn't feel like it's incredibly experimental. Rails is an exercise in problem-solving, deployment is generally a nightmare and the literature/"best-practice" guidelines are minimal, plus Rails is still changing and regularly breaking backward compatibility. Someone correct me if I'm wrong - that's my impression after a couple systems built on it.

As for Python... when I've tried to use it it's felt far more like work than fun. And I still haven't been able to convince myself that compiler-time typing is a bad thing - remember that the vast majority of developers are below average in ability, and the compiler helps a lot.

Perhaps the future is things like Scala that run on the Java platform, or even DSL's built specifically for projects that compile to byte code.