Let's reconsider lombok
See original GitHub issueI saw the old discussion on the #2008 and #2066 around removing the lombok dependency, and do understand your reluctance to include a number of 3rd party libraries, but I want to make the case for lombok again.
In my recent java development, lombok has become so common, that I almost consider it a part of the language. It ends up reducing a huge amount of boiler-plate code, and also reduces maintenance overhead - e.g. for toString(), equals, hashcode and constructors.
In most of my other projects, my DTOs look like this:
import lombok.Data
@Data
public class DepositAddress {
private final String address;
private final String destinationTag;
}
and that’s it. @Data
gives you an RequiredArgs Constructor, Getters, Setters (for non-final fields), equals, hashcode, toString. If you end up adding, removing or moving around fields, the generated toString / equals / hashcode changes automatically.
Also, most IDEs (definitely Eclipse and Idea) now have first class support for lombok, so generated getters / setters & constructors show up correctly while coding in other classes.
https://github.com/timmolter/XChange/pull/2008/commits/7f7b162cbfa434cc3d4196a93e0d0b98bd13f831 is actually a good representation of the before / after state of using lombok.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:31 (25 by maintainers)
Top GitHub Comments
I don’t see a real big benefit of introducing lombok at this point. Is just reducing boilerplate code really the only benefit? What about potential drawbacks such as:
Since I never used lombok, I don’t have a sense if any of the above issues will arise or not. It seems that the potential risks outweigh the rewards.
Well after leaving this open for discussion for some time now, it looks like the majority vote for having lombok as an option, but not as a requirement. Feel free to add it and start using it then…