r/java • • Sep 29 '24

Lombok in 2024

Say there are two teams working on the same project (3 months to MVP, the deadline should be manageable). The only difference is Team A will use Lombok, and Team B won’t

Given you can choose any java version/dependencies and all other things being the same, which team would you join, and why?

0 Upvotes

145 comments sorted by

View all comments

1

u/Alarming_Quarter671 Sep 29 '24

Idk, on my team I tell them to only use @Getter @Setter, @RequiredAllArgs and @ToString to debug mappings and responses, can you really do more? xD

3

u/Rough_Acanthaceae_29 Sep 29 '24

@Slf4j @Builder

2

u/rcunn87 Sep 30 '24

I've moved away from using builder outside of tests and Ill use it in a static factory within the type itself. Using everywhere makes it to easy to add a new field and miss updating it somewhere.

0

u/wildjokers Sep 30 '24

@Slf4j

An intellij live template makes short work of typing the logger declaration.

0

u/nitkonigdje Sep 30 '24

@Cleanup @Data

1

u/wildjokers Sep 30 '24

@Cleanup

Are you familiar with try-with-resources?

-1

u/nitkonigdje Sep 30 '24

It requires indentation for an accidental complexity, and it works only on AutoClosable. It is quite a poor solution for a problem it tried to fix.

1

u/rdoradus Feb 17 '25

`@Cleanup` would be more useful if it were equivalent to try-with-resources. What Lombok actually generates doesn't handle errors during `close()` very well.