Tuesday, December 16, 2008

Is Java Dying a Slow Death?

There have been numerous reports of the demise of Java ever since the language gained popularity. However with SUN's market cap at $3 billion there have been renewed speculations that because SUN is in trouble Java is too.

First off, Java is a lot bigger than SUN, its out in the ethyr. Nobody controls Java (except the Java community) is its own entity. This is obviously a good thing for companies and developers. Java is not going to die because SUN is in a spot of bother.

I do believe the adoption curve of Java is on the decline. This is not due to a lack of popularity, rather the opposite. Java has enjoyed massive popularity over the last 12 years, it became the multipurpose language of choice for millions of developers and a large percentage of enterprise. And why not; Java combined the "write once, run anywhere" principal (that sort of worked) with the building blocks to create embedded applications to hugely scalable enterprise systems, simplifying memory management, concurrency and IO. However, the popularity of Java meant that it was used in places that it was not deigned for.

The fact that Java is a multipurpose language means in many cases it is not the best tool for the job. We've seen over the past 5 years new languages such as Ruby, Scala and Erlang become more popular. Ruby provides a more fluid, powerful language that is great for building front end applications, Erlang is always going to beat Java for scalable, robust back-end applications.

Also the way we build software is maturing. We are getting better at using the right tools for the job. We use patterns to describe nuggets of software wisdom, we use IDEs that tells about good practices, we use DSLs to help better describe what our software is doing. With this maturity we look to other, sometimes more specific languages to help us get to our goal more efficiently and elegantly. For this reason Java is not as popular as it once was, but Java's popularity was probably over-inflated in the first place.

A dying language is one that stops living. A living language is one that continues to grow. Java does continue to grow with JDK 7 considering support for closures, resource blocks and language-level support for XML. Additionally, support for a module system will greatly increase the flexibility of the Java run-time (if implemented correctly - I wish they would team up with OSGi). In java 6 we got built in support for scripting languages such as Python, Ruby and of course Groovy. These sorts of features allow a language to grow.

The challenge for a mature language like Java is that with every new release there is an accumulated legacy to deal with. Eventually, the weight of that legacy will crush the language. I don't think Java is anywhere near that point yet.


Martin Wildam said...

Any language using after a while of living will produce legacy issues.

For a long time I did evaluate the future language to use (coming from Visual Basic) and I have chosen Java - even from the current point of view.

I think that Java has a bad reputation sometimes because of older issues with earlier versions. It seems that there are many people still running on JDK5 although the 6 does exist already for a long time.

As I mentioned on my blog - the core language features are only one side but for efficient software development there are more factors important also (see The IDE and the libraries).

aperepel said...

Knock-knock! Who's there? Closures. What closures? Closures which got dropped from Java 7.

Java 7 will not have closures, that's official. However, they've committed to a really modular jdk, one making osgi and similar a reality.

Doesn't mean Java is dying (if I hear that word again, I will turn nuts).

Neal Gafter said...

"...closures, resource blocks and language-level support for XML"

No. Nope. Not that either. Wrong on all three counts.

David Dossot said...

There is more to Java than the language itself: what about the JVM?

For me, as of today, it is the best runtime environment you can have. It is cross platform, manageable and extremely efficient in term of performances and memory management.

Hence, whatever language you use (Java, Groovy, Scala), the JVM will keep playing a prime role. And I think this will keep lasting for a little while...

aperepel said...

It gets even more twisted with things like Ja-NET. http://www.infoq.com/news/2008/12/Ja-NET

So, now a Java program compiled into a .NET native assembly running on Linux through Mono doesn't seem impossible (the example is absurd, but still...) To me that means Java is thriving, just in some different way from 'kewl new toy'