r/java • • Oct 05 '23

How does the lombok magic work underneath?

https://www.unlogged.io/post/how-does-the-lombok-magic-work-underneath
133 Upvotes

143 comments sorted by

View all comments

Show parent comment

8

u/zman0900 Oct 06 '23

Worst case you can always just run delombok and your auto-formatter on everything, should the lombok project ever die.

1

u/rastaman1994 Oct 06 '23

I'd rather not wait for the inevitable. The time we saved with Lombok is lost arguing about Lombok or explaining the magic. How many times a month are you adding/removing fields anyway...

10

u/hsoj48 Oct 06 '23

I work at a fortune 50 company that heavily uses lombok. No one in real life is arguing about it. I don't get the issue. Don't use any library ever because someday it might change amirite?

1

u/rastaman1994 Oct 06 '23

We're a bit smaller and we prefer not to, that's all there is to it. Before all the arguments between Java and Lombok devs started popping up, I'd say it was only a preference thing. Now there's just a tiny bit more risk attached to using it. I'd consider it for legacy Java 8 or lower projects, never for 17 and beyond.

1

u/[deleted] Oct 08 '23

[removed] — view removed comment

2

u/rastaman1994 Oct 08 '23

Without knowing the use case, it sounds like you need a value object, I.e a record. I'm assuming ur talking about value objects like SomeBusinessId or Birthday.

3

u/[deleted] Oct 08 '23

[removed] — view removed comment

3

u/rastaman1994 Oct 08 '23

I presume the majority of projects that have a use for Lombok are <17 like yours.

I disagree that Lombok in itself encourages good design, it's always the practices agreed on by devs, but I can't prove that. The annotations are noise too for some. I've just never really been bothered by Java's boilerplate, and the people that are can use Kotlin.

These discussions are just always so pointless.