Re:New Features in Java 14
by lmm on Tuesday March 03, 2020 @09:33PM
(#22480739)
You can use named parameters if you're worried:
Scala's approach to constructors is a good example of convention over configuration; in Java 99.9% of classes have a constructor like:
which is just ceremonial boilerplate that obscures the actual logic of what the class is doing (an IDE can generate the constructor for you, but the person maintaining your code still has to take the time to comprehend it). You can do the more complicated things in cases where you need to, but it's important to keep the simple case simple.
[ Parent
| on HN ]
Lombok solves this for Java.
Using Lombok ends up being just as much effort as using a different JVM language, and the rewards are smaller.
The learning curve is way less steep, and you can introduce it into an existing project with zero impedance mismatch.
Yes, but in teams where there is no hope of switching to another JVM language like Kotlin, Lombok can reduce boilerplate by enormous amounts.
It's a compromise.
Lombok is really not that complex and it not close to using a different language.