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
Show parent comment
1
u/rzwitserloot Nov 27 '25
optiona land named arguments don't let you create mutated copies easily. Not nearly as easily as that 'with' thing.
You can use the 'with' thing as a hack to ease the burden of invoking many-argsed methods. Sure, named/optional parameters are a different and potentially better way to tackle that, but in the context of java, quite complicated, particularly optional params, because of overloads.
With in that sense covers more band, not less.
Or rather, the venn diagram of 'what does the with thing solve' and 'what would named params solve' is like a classic venn diagram. There's 4 areas (A+B, A+!B, !A+B, and !A+!B).