Hey guys! How’s it going?
The record keyword is ready for production use in JDK 16, which officially will be here mid March. Spare lots of keystrokes and get rid of code generators and IDE magic with this new keyword!
In addition to spare typing, your Java source code also is getting much easier to maintain and to understand, as it is so concise and fully integrated into the compiler and the runtime. While, besides of shorter source code, there is no measurable speed gain or reduced binary footprint currently, I could imagine that in future the runtime could further optimize records, as it knows that records are definitively immutable and non-extensible.
Maybe project Valhalla will then treat them as primary data types, as they already are best suited for passing around pure values — so your code would run in double speed consuming half the memory?
Secure a headstart: Use Java 16 NOW!
Project Valhalla: https://cr.openjdk.java.net/~briangoetz/valhalla/sov/01-background.html
Valhalla change log: https://github.com/openjdk/valhalla/commits/lworld
Stay safe and… Party on!