You may have moved on, but Java is thriving

by
Tags: , ,
Category:

Some of the developers I know who used Java back “in the day” (90’s, aughts, early teens) have moved away from the platform. Well, I say the platform, but I’d be misrepresenting it. Many of them moved away from the language, but not the actual JDK (I’m looking at you, Clojure, Scala, and Kotlin users).

If you are one of those people who left the Java language before it got into functional programming with Lambdas and Streams (likely because you’re using Clojure or Scala), we’ve got news for you. Java has steadily improved its capabilities over time. It has strong functional processing support, using streaming and parallel processing if needed, to practically do most things that Scala can do without changing languages.

Love your Scala REPL? Java has one – it’s been there for a while now: JShell. You can use it in much the same way as other REPLs, complete with tab completion, pre-defined imports, redefining consts and classes, supporting forward definitions (writing a function that refers to a class you haven’t pasted yet? JShell is patient, and will let you run the function once you paste the new class in the REPL).

Java has enhanced its syntax, including adding the `var` keyword to handle type inferencing, turning switch into a pattern matching expression, adding Records for simple data objects, providing a sealed class/interface mechanism to narrow type hierarchies for library creators, and much more.

The OpenJDK projects, their Java Enhancement Proposals (JEPs) and goals are all documented at openjdk.org, so you know where Java is heading. Many distributions of OpenJDK are available, which is a good thing based on Oracle’s latest commercial JDK licensing choices. In short, rather than running a language bytecode-compiled to the JVM, there are less absolute reasons to push to another language these days.

At Chariot, we’ve recently created a Modern Java update course on our course listings page that covers Lambdas, streaming, language and JDK changes. This is a customizable course, and we can add in a tutorial on Spring Boot, or full stack Java, if needed. Reach out to us, and we’ll tailor a class to your needs. We also offer mentoring or project advice, so if you are moving your team to Java 20 and want to schedule a review, please drop us a line.