Java
One of the most significant features of Java 21 is Virtual Threads (JEP 444). These lightweight threads reduce the effort needed for writing, maintaining, and observing high-throughput concurrent applications.
Around 6 years ago, I wrote about using Java for shell scripts. It was a hacky and fragile way to convert some Java code into a shebanged file containing the content of a Jar file.
However, Java evolved quite a bit since that article, so it’s time to look at it again.
A new garbage collector was introduced in Java 11, a low latency/high scalability GC called ZGC. And now, with Java 21, it has evolved into a generational GChugo .
Pattern matching is a declarative and composable approach for more powerful and expressive code. Java 16 added pattern matching for the instanceof operator, and we looked at pattern matching for switch before. Let’s look at another new kind of pattern matching: Record Patterns.
Even though Java is one of the most backward-compatible languages and environments I’ve ever worked with, there’s always the possibility of feature deprecations and even removals.
The switch control structure has quite an evolution lately since its inception. First, there were switch expressions (JEP 325, 354, 361). And now, we get pattern matching for switch statements and expressions!