Sunday, November 06, 2005

Technical - "Beyond Java"

"Beyond Java" is a book by Bruce Tate, on possible future of programming after Java. The author was inspired to write this book after the following experience. He and a friend built a web based application for a startup company using the current set of Java tools and frameworks (Spring, Hibernate etc). The project took about two months, with about 20 hours of work a week dedicated to it. Then, on a lark, the two guys decided to build the same application using Ruby on Rails framework. To their surprize, they built the same application in about 4 evenings of coding.

Even given the familiarity with the problem, the productivity speedup was amazing - not to mention that the Ruby application performed better. This experienced was a wake up call for the author, not to be too comfortable with his current tool set and to consider what else might be coming up from the non-Java fields.

Besides describing the above experience the first part of the book covers some problems that exist with Java and Java based tools and frameworks. For example, the fact that the basic types in Java (int, char etc) are not full classes leads to all kinds of ugliness and unnecessary complexity in Java APIs. Ironically features like these helped Java become so popular among the former C++ and C programmers.

The other main problem he sees with Java is that the frameworks and tools build around Java have become too complex. One reason is that Java is now used in many large "enterprise" systems - where this complexity is needed. However, in so doing Java has left behind those who do not wish to build "enteprise" size systems. Just to write a simple application that retrieves data from database and shows it in a web page, requires several frameworks, each of which needs to be configured in its own flavor or XML. That's why PHP and Ruby on Rails are so popular.

Following all the complains, the author provides some possible answers of what the future may be like. He believes that more dynamic languages (like Ruby) are the future. In fact he dedicates a chapter the to Ruby on Rails framework and another to "Continuation Servers" and Smalltalk (in particular he discusses the Seaside Smalltalk continuation server). "Continuations" are feature of may functional programming langauages (although they are present in Python, Ruby and Smalltalk) which allow us to invert the stateless model-view-controller approach to writing web applications into a more natural way of programming (i.e. ask for some input, wait until it comes, process it and display output).

The book is fairly short - I read it online using my O'Reilly Safari subscription. You may not care about Java that much, but if you are interested in the future of programming this book presents some intriguing possibilities.