Seems like there is a buzz in the air these days about the demise of Java. Two recent examples include Marc Andreessen’s comments on how Java has acquired all the issues that its predecessors have and how PHP will take the lead away from Java in the not so distant future and Bruce Tate’s recent OnJava article on specific places where Java is losing ground to other languages.
So is Java on the way out ? I hope not, because I believe that fundamentally Java is a great language, but Java does have some real problems. I think the root cause of most of the problems is Java’s enormous scope and complexity.
A couple of months ago, after reading all sorts of articles on Ruby and Ruby on Rails, I decided that I would try them out. My goal was not to create some epic program, just to get something working that gave me an idea of what Ruby was all about. I started by downloading and installing Ruby (not realizing that it was included in OS X) and some libraries, then I downloaded and installed Ruby on Rails, then I found an article at OnLamp.com and used it to create my first Ruby on Rails application. Total time from the first download to the program working, including setting up the database, was somewhere between an hour and an hour and a half. Not too bad, from my point of view that is just about the right amount of time a developer should be willing to dedicate to going from no knowledge to having a simple working demo. The same thing in PHP might not have been as easy to code, but the setup would have only 10-15 minutes, giving me more than an hour to code up an example
How long would that whole process take in Java? Just think of all the steps involved: downloading and installing the JDK, figuring out to use Tomcat (or some other servlet engine), installing Tomcat, getting the JDBC driver, setting up the JDBC driver, deciding how to do the database queries (either through your own code or with Hibernate or some other package) — then assuming I didn’t go off shaving yacks, I would finally be ready to sit down and write code.
Think about this: Java is so complex that new OS X versions come out months after the Windows and Solaris versions and needs to be compiled and optimized by Apple, not Sun.
What’s worse for all this complexity, we don’t even get :
- a basic scripting language
- a built in, simple web server
- a built in, simple servlet container
- a built in build tool
Sure all of these things exist in the greater Java community (Groovy, Jigsaw, Tomcat and Ant respectively, for example) but since a large amount of Java’s installed base is developing web apps, why does Sun keep adding marginally useful Swing widgets instead of trying to include things that developers might actually use ?
What does Java need to do to get it’s act together ?