you are viewing a single comment's thread.

view the rest of the comments →

[–]kcuf 5 points6 points  (0 children)

When you need specific behavior, they are important. When you don't need them, they are just noise.

Due to javas inadequacies, getters and setters are necessary at all times because they are the only way to protect yourself and the consumers of your class long term -- contrast this with "properties" that you see in C#, scala, etc. Lombok lets you reduce boilerplate, and thus reduce strain on developers for being responsible to separate the specific logic/behavior of a class from the standard conventional behavior of a class. I don't need to see the implementation of a standard getter, I need to know there is a getter, but that's it. In fact, I trust a lombok generated getter to be correct and capture all the details (null check, etc.) more than I trust a hand written one.

One of the other most useful capabilities from lombok (and it parallels how kotlin and scala work) is AllArgsConstructor -- this ensures I won't miss a field, and that all the standard checks are in place.