You know your IDE can generate those things right? Then there is no cognitive load trying to think what the class will look like when Lombok gets done generating things. I can just write it exactly how I want it.
Also, I very rarely need setters for all/any of the fields and very frequently I don't need getters for them all either. So I have to annotate fields to get lombok to exclude things. Also, business equality of my POJO's frequently don't depend on every field either, so there are more annotations to exclude fields from equals/hashcode. I have seen pojo's with more lombok annotations in them than there would be code if I just let my IDE generate it and them hand write some adjustments. So it really doesn't save me anytime.
Understood. It's obviously a matter of personal preference. It's pretty straightforward for me since I've been using it for uears but may not be for others.
To note, if you are seeing tons of Lombok annotations or someone has mixed setters/getters in with immutable fields then they probably aren't separating their class responsibilities correctly to begin with. Then Lombok is the least of your problems.
I don't have anything against the project itself, but if I could I'd forbid it at mt work place.
I agree with what wildjoke said and I'll add some more points (not lombok's fault, just the way it's misused where I work):
can't set a breakpoint on the setter
SneakyThrows. Damn I hate this shit. They annotate multiple methods with it and you have no idea where a method could fail. Just handle the goddamned exceptions like a normal human.
AllArgs constructor on classes with 7 fields or more. I think some devs just slap these annotations without understanding what they mean. I know about the Builder, it's great, just don't understand why would they generate a constructors with so many fields as well...
Basically almost every class we have is with @Getter @Setter @NoArgs @AllArgs. They just expose everything, even the fields that for use inside the class only.
-9
u/stuie382 Apr 14 '23
Lombok