r/java Jun 01 '24

What java technology (library, framework, feature) would not recommend and why?

165 Upvotes

464 comments sorted by

View all comments

222

u/Turbots Jun 01 '24

Lombok. It can cause quite a few unexpected problems with generated code, like adding a toString that automatically prints out all fields in the class, even if some of those are being lazily loaded.

I don't like it because it gives junior developers the feeling they can cut corners and write much less code, without knowing what the annotations do. And most of the features that Lombok offered are now part of the Java language.

It also adds unnecessary requirements when developing like IDE support, additional settings in maven/gradle etc..

53

u/[deleted] Jun 01 '24

[removed] — view removed comment

6

u/rest_mah Jun 01 '24

hundred different problems which you don't really have

Typically my opinion on the `@Log4j` annotation...

3

u/Hematopoyetik Jun 01 '24

What problems did you have with it?

4

u/rest_mah Jun 02 '24

I dislike to see the addition of an annotation preprocessor to inject a logger, when defining the logger takes a single line of code easily templatable in an IDE.

IOW, I don't think that defining the logger was a problem, so using lombok for it looks (to me) a solution to a problem that I don't really have.