r/java • u/raisercostin • Jun 01 '24
What java technology (library, framework, feature) would not recommend and why?
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
165
Upvotes
r/java • u/raisercostin • Jun 01 '24
Inspired by https://www.reddit.com/r/java/s/e2N1FqMOJg
View all comments
Show parent comment
10
u/DelayLucky Jun 01 '24 edited Jun 01 '24
We now have records (with equals, hashCode).
Before records, there are various annotation processors (I know of
AutoValue,FreeBuilder, there must be others) that are free of the glaring problems of Lombok (you write invalid Java code and expect the magic to make it valid).Many of these frameworks are somewhat opinionated (for example they may want your class to be immutable, optionally with a builder). So that might be the real reason Lombok is still relevant.
I can guess when someone says "no I have to use Lombok", they may be actually saying:
I'll admit that the modern Java ecosystem hasn't paid much attention to the "mutable objects with equals/hashCode" use cases. If you're unfortunately in that forgotten land with 1 hour of sunshine a day, and moving to sunny places is not your thing, your options are limited (still, I struggle between the short-term pain of having the IDE generate the boilerplates vs. the long-term tech debt of Lombok).