I’ve been working with Java for 25 years. After a shaky time in the noughties, the platform has thrived, and a huge number of applications have been built on it. But I’m starting to wonder about Java’s future, given three things: new features in the language, the JVM itself, and the rise of generative AI.
When Java started it was an exciting prospect – an object-oriented language that could run on multiple platforms, but without the complexities of C++. During the 00s it had looked like newer languages would take its place, but with Spring Boot it’s become a popular language on the cloud.
It’s been a long time since Java was cool, but CTOs definitely like it and there is a massive sunk cost invested in the eco-system. While I’ve worked with other languages, I expected to be working primarily with Java for the remainder of my career. Some people have mocked Java as the new COBOL, but I see a steady supply of work as a positive thing.
One of Java’s strengths is its simplicity. A couple of years back, I published an article for my previous consultancy about Why Java Still Matters. I concluded that Java’s strength was its readability compared to other languages, and that helped with collaboration: “[Java’s] lack of sophistication forces developers to produce more straightforward code [and] we write code for other developers, not the machine.”
Since 2017, Java has committed to twice-yearly releases, which has led to a large number of new features in the language. I have argued (mostly in jest) that Java peaked with version 7, before the introduction of functional programming features. The new features in Java are undoubtedly expressive, but at the cost of some consistency. For a long time, Java applications tended to look very similar between workplaces. This will be less true as the language becomes richer.
If Java stops being a simple language it becomes less compelling as a choice. Indeed Java’s backward compatibility has produced some strange versions of modern features. Why not pick a language that was designed from scratch to include these things?
Java also brings with it the deadweight of the JVM. While Java is fast once it’s up-and-running, there are significant start-up costs that are particularly punishing on serverless. Yes, there are workarounds but these bring their own problems. GraalVM’s incredibly fast start-up comes at the cost of slower build times and significant differences between production software and development versions. Over the past few months, my workplace Java user group has been discussing the problems of Java on serverless and the outcomes are frustrating. It’s hard not to feel like we’re making excuses for the platform we work on.
Despite both of the above issues, a lot of money was invested in Java, and companies were unlikely to switch. But, with the rise in generative AI, it’s easier than ever for developers to get working with unfamiliar languages. And it’s also going to get easier to convert existing applications to new platforms. The first tools to do this are imperfect, but they will improve.
Java has always been a clunky language to work with. The boilerplate made hacking on new ideas unrewarding (although tools such as JHipster helped massively). GenAI supports me setting things up on new language, and it’s a great tutor, able to hone its examples to support the specific thing I’m trying to build.
I’ve had a lot of fun working with Java over the years, but I’m starting to feel that, long-term, my future lies with other languages. It’s time to explore some alternatives.