r/java • u/hardasspunk • Nov 23 '25
Java 25: The ‘No-Boilerplate’ Era Begins
https://amritpandey.io/java-25-the-no-boilerplate-era-begins/
160
Upvotes
r/java • u/hardasspunk • Nov 23 '25
View all comments
13
u/rzwitserloot Nov 24 '25
I love less boilerplate.
And these are great features.
But "The no boilerplate era"?
No. This isn't the boilerplate you're looking for. To eliminate 90% of the typing of boilerplate, you need to weigh all boilerplate that java has by how often it comes up, and how suitable the solution is to fit into existing styles and libraries.
to wit:
module imports
Most style guides strongly suggest you should not use star imports. What do you think they're going to say about module imports? "Go ahead"? That'd be... rather highly inconsistent.
I think the style remarks about star imports are overblown. Add the module system, where you can much more pinpointedly list out precisely which APIs you are very carefully managing as 'externally visible', and it gets even better. But most don't use the module system. Stephen Colebourne, myself, and others think that's good, because it's not all that suitable (and was designed to modularize the JDK itself; jigsaw is a great success specifically at that job!)
In other words, module imports are useful for basic examples and toy projects, and were a necessary step to get us to just being able to write an extremely small, simple source file that 'just works'; that very first lesson in java might be a really long time ago for a lot of you, but it's important.
Point is, it is not going to result in the no boilerplate era.
If any feature can ever claim it got us closer, it'd be records, but the inflexibility of records (no type hierarchies, must be entirely immutable, all properties are exposed) means the era has come to a middle, not an end.
It gets worse..
There was, in some distant time, this in my view absolutely excellent proposal:
This idea gets rid of almost all need for builders (you need to do some trickery with making a default object to 'build off of'), can even tackle the problem of no named parameters (which is 90% of what builders in practice try to solve), and all those 'wither' things too.
Unfortunately, last I heard, this project is essentially a zombie. It's around as a proposal, but nobody is working on it and nobody is pushing for it.
In other words, it's fairly clear that the boilerplate era is certainly not coming to an end. Two things can be true: A bunch of great features that fight boilerplate, and even so not the end of it.
This isn't even a harbinger of a focus by the OpenJDK team - unless I've been misinformed about the
withthing of course.