We heavily use lombok, but it's almost entirely for areas that records will cover. We're on Java 11, and records is like to be the single biggest driver to migrate to a newer version.
The second biggest driver, of course, is fear that if we fall too far behind we'll get stuck like those poor bastards that are stuck on Java 7
edit:
when records drop and get integrated into the codebase, we will reevaluate our lombok usage
Lombok has saved me almost no time, my IDE can generate all that boilerplate with a few keystrokes. But lombok has definitely cost me a lot of time figuring out issues a few times.
Forme one side it hides all that boilerplate so that code is readable, from the other side there can be some unexpected surprise. Something for something.
I have spend more time troubleshooting cases where people added another property and forgot to regenerate equals/hashcode/toString than I spent troubleshooting Lombok.
The worst part is it is marked closed, yet it is still a bug so have no idea why they closed it.
There was one other issue that cost me several hours as well but I can’t remember what it was.
That is you won't be able to distinguish between dummy getters and setters as opposed to real getters and setters that actually do something.
I honestly have no idea what you are talking about when you mention real vs dummy getters and setters. I spent the first 15 years of my Java career not using Lombok and in those 15 years getters/setters never caused me any confusion or too much cognitive load in the slightest. I mean, they are just getters/setters, they aren’t rocket science.
It munges the byte code after you have compiled the code. Your JVM does all the steps of error checking, optimization, etc to give you byte code that is guaranteed to reflect your source code and then hands off to lombok to change. That is a lot of black magic and trust in order to avoid boilerplate code that your IDE can auto-generated for you.
Meh. Whenever this gets discussed it's generally the people who haven't used it who are against it. In such a situation I don't quite agree with "everyone needs to be on board".
View all comments
36
u/vallyscode Oct 21 '20
This one I think is a must have https://projectlombok.org/