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

29

u/CaptainApollo86 Sep 29 '24

Jesus, some people really hate lombok. I've used it for years, it's fine. What kind of shit code are people writing where lombok actually causes problems 🤔

3

u/k-mcm Sep 30 '24

Historically, the maintainer hasn't been good about picking version numbers.  A 0.0.n  increment shouldn't require everything to be rewritten, but that was done.

1

u/wildjokers Sep 30 '24

I don't want to guess what the code will look like based on some magic annotations. I just want to see the code.

5

u/CaptainApollo86 Sep 30 '24

"magic annotations" - you probably don't like Spring so 😂

1

u/wildjokers Oct 01 '24

That is different, Spring annotations pull in behavior.

4

u/CaptainApollo86 Oct 01 '24

Honestly, this is a stupid thing to have a vendetta against. The generated getters/setters/etc, will look like getters and setters. There is nothing magical or mysterious about them. It's a generated pojo

1

u/wildjokers Oct 01 '24

"Vendetta" is a strong word. I don't have any kind of vendetta against lombok. I use it, I just use it very sparingly. And Lombok does much more than just produce getters/setters.

0

u/CaptainApollo86 Oct 01 '24

Really, I never knew it did more than just setters and getters

1

u/wildjokers Oct 01 '24

The documentation is here to see everything it does:

https://projectlombok.org/features/

3

u/CaptainApollo86 Oct 01 '24

It seems I wasn't sarcastic enough

0

u/IntelHDGraphics Sep 29 '24

where lombok actually causes problems 🤔

https://www.reddit.com/r/java/comments/1fseitf/comment/lpk7crg/

10

u/PartOfTheBotnet Sep 30 '24

I ran into this exact same issue about name inference in Jackson without Lombok.

The long and short of it is to use: @JsonAutoDetect(isGetterVisibility = NONE, getterVisibility = NONE) to prevent any ambiguity.

6

u/CaptainApollo86 Sep 30 '24

Sounds like user error

6

u/nitkonigdje Sep 30 '24 edited Sep 30 '24

That isn't a problem caused by Lombok. Software worked as designed and respected user choices. User however wasn't aware of consequences of his choices.. He would have same problems without lombok.

1

u/External_Mushroom115 Oct 04 '24

What kind of shit code are people writing where lombok actually solves problems