Hacker News new | ask | show | jobs
by Lewton 42 days ago
Lombok fucking sucks

@requiredargs sucks, if you rearrange the order of two fields with the same type on a class you invisibly break the code. If you have multiple constructors (requiredargs, allargs) it makes tracing how they’re used using the built in tools of your IDE impossible

@builder fucking sucks, if there’s non-nullable fields and you don’t set them, at best you get a runtime exception. Builder pattern should take non-null args explicitly in the builder() method so when you add a new required field it doesn’t invisibly break code 8 modules away

Only good thing is indeed the log annotation, and to some degree @getter @setter, big whoop

2 comments

> tracing how they’re used using the built in tools of your IDE impossible

It is possible but requires more key strokes. It is annoying, but possible.

Can you elaborate?

To be clear, I know how to look up where the class is used, and i know how to look up where constructors (note, plural) for the class is being used, but I have not found a reliable way to find where a specific constructor is being used if the class has multiple

I use Idea with eclipse shortcuts. I have lombok plugin.

Ctrl-O for a popup window of all methods. The lombok generated constructor is there. Highlight it and then shortcut for call hierarchy. Ctrl-h or ctrl-alt-h I am not sure now.

If you don't like it then don't use it and carry on. No need to litter the world with such negativity.
There is a litany of expensive consultants coming in and shitting up code bases worldwide with cargo-culty supposed 'best practices' like Lombok. It is good to call it out.