Last year, I picked up this book which seemed to sum up the zeitgeist of web programming in 2005, an interesting and polemical twist from O'Reilly. Beyond Java is a fascinating read, and outlines its case clearly without degenerating into flaming rants. Although the book has been widely criticised as being a trojan horse for promoting Ruby, while ignoring or giving only a cursory overview of other important languages, it's clear that Bruce Tate is assuming a certain level of sensibility and awareness of readers in being able to understand the issues and make up their own minds. It would be easy to fill an entire book with Smalltalk alone, but that's not the point.
The main argument that Tate makes is that any viable Java successor must be compatible with the JVM. This requirement is driven by the glacial creep of legacy enterprise systems, stuff that's not going away any time soon, and thus will remain the primary concern of a vast number of working programmers worldwide. This, combined with the common critique of statically typed syntax in web programming, suggests that the best direction for Java could be to promote the language as a fertile platform for implementing web specific DSLS. By all accounts, this movement is well on the way with JRuby. I've used this a bit, and it is impressive to say the least - though I did have some significant hassles with IO on Windows. JRuby currently lacks a chunk of native functionality that will allow it to run Rails, but it's a safe bet that the day this is properly implemented, we'll see a wave of excitement that bridges the gap between the Java and Ruby communities.
If we think of Java less in terms of language syntax, and more in terms of software development processes, it's interesting that Tate doesn't mention the various movements in Java beyond the monolithic conception of object oriented programming that the functional mindset loves to hate, most significantly aspect oriented programming. Tools like AspectJ have been around for a while now, but up until recently, haven't moved beyond the hype and logging cliches. There is potential yet, for the successor to come from within Java itself, a possibility that Tate himself admits, although he chooses not to follow the possibilities of this direction. But you'd be wrong if you thought the battle was really about static vs dynamic languages, or even verbose C influenced imperative coding vs a Smalltalk influenced style of closure blocks. Recent hoop-la suggests that the real battle is directed at bringing down the notion of the "Enterprise".
From my observations, there seems to be a certain attitude circulating amongst many developers who've picked up on the Rails platform, that the answer to any server side web problem is JustUseRails. Regardless of lofty claims, this is not a philosophy or a development methodology - it's simply dogma, exactly what they're accusing their enemies of. Rails is valuable in the way that it solves common web problems so easily and effectively, but it's really hard to appreciate this when it's constantly used as a stick to beat other possible solutions. In this context, it's also becoming increasingly common to see the Java language itself get conflated as a shining example of everything that is bad with bloated and overcomplicated enterprise software.
The problem is that management and development are two separate things, and there exists no 1:1 correspondence between languages and development methods, nor a 1:1 correspondence between languages, methods and the application frameworks themselves. Despite various claims about programmer productivity, there can never be an empirical argument that proves Ruby is "better" than Java in any way. It's just not possible to analyze languages or social processes like that. It's ridiculous to wage a war on Java itself as part of this movement to bring down the Enterprise. I've seen seen messy spagetti Ruby code littered with Perlisms, just as I've seen elegant and minimal Java that solves massive cross cutting problems in less than 100 lines of code. The fact that examples of code like this aren't particularly common in either language doesn't change the fact that it's possible to write good and bad code in both, and that each has situations that they're ideally suited to.
If we took a low level flight over the current battle lines for web programmer mindshare, and drew it up into a list of frameworks; as of March 2006, it might look like:
- Rails (Ruby) - the vanilla of modern web development, pushes Ruby idioms into the limelight, and comes up with a few idioms of its own that make previous conceptions of minimalist web frameworks look clunky and bloated.
- Spring (Java, JSP) - making waves in the Java community, with a clean encapsulation of complex functionality behind a straightforward MVC interface, and integrating smoothly with various mature libraries.
- Zend Web Framework (PHP) - the big unknown of 2006, this will either be revolutionary, or a recidivistic lapse into the same old problems with PEAR that helped drive the success of projects like Rails in the first place.
These frameworks seem to be getting the most attention but they are not the only contenders. While seemingly not moving with the momentum it had in 2003, .NET is still significant and Microsoft have been steadily iterating the language itself, which has now moved far beyond Java, with new features like LINQ. PHP has spawned a culture and community which is growing ever stronger, and Java influenced features in PHP5 like interfaces and private/protected members are encouraging many experienced OO developers to turn to the dark side - projects like WACT and Code Igniter illustrate the range of possibilities. Python is kicking serious ass at the moment, with all manner of cool web toys, ranging from the minimalism of web.py to the generative structure of Django. There's also Seaside, a Smalltalk framework full of interesting ideas, which is given brief attention in Tate's book.
There's no doubt that for some, Rails is the way, the truth, and the light. But whatever you place your faith in, if you can't accept that we live in a secular world with fantastic alternatives, your opinions about software development are worth less, and won't be taken seriously by programmers who value free thought and rational informed debate. While I appreciate the need to address some of the misinformation and falsehoods being thrown about by idiots masquerading as enterprise consultants, responding in flames is pointless and counter productive. If these kinds of posts continue, they're going to start to reflect badly on the credibility of certain leaders of the Ruby community whose dogmatic muck slinging is starting to overshadow their innovations.
The debate (and possibilities for interaction) between Ruby and Java is a lot richer and more interesting than the question of whether to use Rails. The current trend in hype that conflates languages and frameworks is harmful, negative, and confusing to beginners who don't necessarily understand the history of programming languages. I'd like to see the proponents of Rails focus more on promoting the positive potential of their efforts rather than continue to flog carcasses that they must know are long dead.
And for Java proponents - yours is still the dominant language, but this is unlikely to continue for much longer, especially if you continue to advocate overcomplicated, verbose, and jargon ridden component architectures. It is not impossible to design simple, minimal, and powerful server API's in a static type system. So why are there so few around?