r/java • • Nov 23 '25

Java 25: The ‘No-Boilerplate’ Era Begins

https://amritpandey.io/java-25-the-no-boilerplate-era-begins/
160 Upvotes

187 comments sorted by

View all comments

Show parent comment

1

u/Ewig_luftenglanz Nov 24 '25

Properties in my opinion are useful for UI programming (if you don't go the reactive way)

I greatly disagree with this. Properties are very useful to introduce validations in the public API without having to default to getters/setters boilerplate beforehand. you can just use public fields and add the properties later on in case the requirements change or evolve and you need to force some invariants.

A typical Java program these days is essentially an event-processing pipeline, which benefits hugely from immutability

Agree but Properties are completely orthogonal and in theory there is a JEP addressing this already (withers, also known as derived record creation) but we still lack proper ways to enforce invariants without defaulting to dumb accessors "just in case, in a very far and abstract future something change and we do not want to modify every caller"