Stay Away from the Light, Java
A few years ago, Java was eschewed by hipster coders on fixie bikes who sneered at its verboseness and poured scorn on the sclerotic pace of Java development. Sadly, they were right. Java had taken a wrong turn by favoring container-based architectures like JEE, resulting in bloated application servers that doled out centralized services like transaction management or security to regimented code that resembled a Hobbesian leviathan (and took minutes to start up). Architectures were layered. DTOs were prevalent. Carpal tunnel syndrome was common. Jaded Java developers typed getXXX() and setXXX() boilerplate until their fingers bled.
But Java (or rather the JVM) had a neat trick up its sleeve – a mature runtime with a memory model that enables genuine multi-threading and concurrency. Sneering hipsters faced scalability problems that were hard to solve with interpreted languages like Ruby and a number of high-profile sites migrated their platforms back to the JVM. But they didn’t return to the bureaucratic, centralized container approaches of JEE but instead blended the JVM’s runtime with functional, non-imperitave techniques borrowed from Erlang and… JavaScript.
The new breed of frameworks include Akka (an actor framework written in Scala and inspired by Erlang), Vert.x (an asynchronous framework inspired by Node but implemented in the JVM) and Finagle (Twitter’s massive scale RPC system written in Scala and running in the JVM). These frameworks do not use servlet containers to do their HTTP dirty work and are based on NIO servers (such as Netty and Spray.io) that abandon the one thread per request model of Java servlets in favor of a more scalable many requests per thread model. The new breed of framework do not encourage rigidly layered, specialized components in a regimented Leviathan but independent, autonomous “actors” that can be aggregated and coordinated in a hierarchy – to stretch my political analogy to breaking point, similar to citizens in a liberal market economy. And you don’t have to code in Java – Vert.x in particular enables application developers to write in any JVM language. Yes, even Ruby.
Rumours of Java’s death have been greatly exaggerated. The Java language itself may be fading in popularity but its runtime seems destined to live on. Should we celebrate this? As a Java developer it would be disingenuous for me to pretend I don’t welcome the JVM’s recovery. But I would really welcome a truly open-source, high-performance polyglot VM unencumbered with corporate “stewardship” – arguably, the Java Community Process was partially responsible for Java’s near death experience by producing standards that mainly pandered to the needs of container and toolset vendors but not to actual engineers (JEE, I am looking at you).

