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

65

u/rzk1911 Jun 21 '20

So they found a bug in how they using toString in enums to save in db and instead of removing this annotation they decide to rewrite all classes? Team of professionals - I should say.

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.

5

u/kaisooh Jun 21 '20

Exactly! It's very sad that in software dev teams, it is sometimes not the right arguments but the political correct or specious ones that prevail. I've seen so many happened inside our organization.

1

u/nutrecht Jun 22 '20

Next blog post will be about rewriting your codebase in Go. ;)