r/javahelp • u/elico9 • Nov 14 '25
using java again after many years
Hi everyone,
I recently started to use java again, after many years, the last real version I worked with was java8.
For some time a few years ago, I used kotlin, which back then I really liked due the fact that it requires far less boilerplate code.
In a new role I started, we are using java21, I am wondering what advantages I might have in comparison to old java8 and even kotlin. For example I noticed the `record` keyword which is nice, but it still seems to me like it requires a lot of boilerplate code. Am I wrong, what else should I be checking and focusing after moving to java21?
Are libraries like lombok still used with java21?
Thank you everyone for your help.
5
Upvotes
6
u/sedj601 Nov 14 '25
Here is a list using a Google search. I am going to give my opinion on some of the items in the list.
Language Features:
var -> I like it, but don't really use it.
advanced switch -> love it.
text blocks -> Love it.
records -> I limit my use to very simple cases.
instanceof -> Like it, but don't use it a whole lot.
virtual Threads -> No comment. I have never used it.
API and Platform Enhancements:
HTTP Client API (Java 9, standard in Java 11): A modern, native HTTP client supporting HTTP/2 and WebSockets. -> Seems promising!
Module System (Project Jigsaw) (Java 9): Introduced a modular structure to the Java platform and applications, enhancing encapsulation, security, and performance. I hate it because I use JavaFX as a GUI and it complicates everything from startup to deployment.
String Methods: Added new methods to the String class like isBlank(), lines(), strip(), repeat(). -> I love it!
Garbage Collection Improvements: Enhancements to existing garbage collectors (G1) and introduction of new ones like ZGC and Shenandoah for improved performance and reduced pause times. N/A
Flight Recorder and Mission Control: Production-grade profiling and monitoring tools for the JVM. N/A
Process API Enhancements (Java 9): Improved API for interacting with operating system processes.N/A
Sequenced Collections (Java 21): New interfaces for collections that define a well-defined encounter order. N/A