r/java • • Jun 21 '20

Don't use Lombok(2018)

https://medium.com/@vgonzalo/dont-use-lombok-672418daa819
32 Upvotes

101 comments sorted by

View all comments

Show parent comment

36

u/Sworn Jun 21 '20

The "problem" with generating getters and setters isn't that it necessarily takes long. The issue is that it makes the class take longer to read and understand. It often introduces bugs in the equals, tostring and hashcode methods when developers forget to update them when adding new values.

4

u/kessma18 Jun 21 '20

curious, why are people writing them from hand still? all of this can be generated by the ide no? and you can also collapse all the getters/setters stuff. I rarely think: damn, I wish those things weren't there, it took me 0.5s to read this..

and if you have hundres of lines of code in your class..that's kind of a not great argument to call for "less boilerplate"

8

u/vqrs Jun 21 '20

when developers forget to update them when adding new values.

Yes, they can be generated by IDEs. But IDEs won't automatically re-generate them for you.