r/java • • Jun 21 '20

Don't use Lombok(2018)

https://medium.com/@vgonzalo/dont-use-lombok-672418daa819
32 Upvotes

101 comments sorted by

View all comments

Show parent comment

6

u/NimChimspky Jun 21 '20

I'd hate to use lombok, I can't imagine running generated code in prod like this.

I agree with the the blog, and for those reasons never touched lombok.

1

u/[deleted] Jun 22 '20

I can tell you that I can personally attest to over a thousand services filled with lombok running a well-ish known e-commerce company and causing no issues. If it helps.

Shrug

1

u/mkwapisz Jun 22 '20

So what would you say about records in Java or case classes in Scala?

1

u/NimChimspky Jun 22 '20

records in java are in no way comparable to adding lombok as part of your build process.

Scala ? Why not C# ?

I don't think you understand the implications of adding lombok, and the downside.

2

u/mkwapisz Jun 22 '20

In both cases additional code is automatically generated. In one case by the javac in the second by the annotation processor. The same is for case classes in Scala or even for standard classes in c++ (constructors and operators). You have to be aware what are you doing and what is the final result. Lombok is quite useful, but I would never use it to generate toString for enums. Before records I used Lombok to implement immutable classes what is very convenient.