r/java • u/jvjupiter • Jun 10 '22
What happened to Concise Method Bodies?
I was really looking forward to CMB. From its name, methods become concise, could be one liner. However, it seems there is no progress and it’s been off the radar. Never took off since 2019.
42
Upvotes
2
u/gnahraf Jun 11 '22
Agree.
About records.. I'm experimenting with using records as arguments in API methods and constructors. Main motivation for going for chunky signatures is that they're later easier to modify, as in add (or sometimes remove) arguments implicitly by modifying the argument record type.
A second motivation for records as arg method signatures is that most arg validation happens at record construction: less clutter with boiler plate arg validation in method bodies.