Hacker News new | ask | show | jobs
by hiram112 3537 days ago
Lombok is a bad idea, IMO.

Getters and Setters are verbose, but usually model classes are contained in a single class anyway, and can be generated automatically with any IDE. I can glance at a typical bean and ignore the code bloat without any problem.

The real issue is that Lombok generated classes don't play well with the dozens of libraries that expect Java bean style methods for auto marshaling and serialization: json generators, commons bean utils, binding libs, etc.

The savings aren't worth the trouble.

1 comments

What problems do you have? Lombok does bytecode generation, I've never had a problem using it with things such as Jackson. How would an external library even know when the bytecode looks the same? I'm entirely aware I might be missing something obvious, this is a genuine question.

You can argue against Lombok for other reasons but was wondering about this specific one.