Lombok Is Still Relevant in the Age of Java Records(swaranga.dev) |
Lombok Is Still Relevant in the Age of Java Records(swaranga.dev) |
Adding a pile of annotations throughout your codebase, often five stacked on top of one another, which generate behavior that is not locally visible, was never a sane trade-off for saving a little boilerplate.
It’s also funny because there is true irl “dark magic” for Java, Lombok and Bali.
Also surprised there isn’t much mention of Bali in general.
agents make dealing with boilerplate easier, but that doesn't change that boilerplate itself is just bad
@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
And I say this as someone who has been writing Python for a living for the past 4 years who rather misses Java and the ecosystem.
e.g. poor support, or late support for
- JWT/Swing desktop UIs
- Web technologies (it used to have a built in JS engine, competing standards, servlets, jsps, jstl, portlets)
- Image processing (ImageIO is limited, Image and BufferedImage were slow)
- Native interop (overlapping / competing standards)
- RPC (CORBA, Jini...)
- Mobile variants (J2ME, Java Profile Variants, Embedded Java, Java card)
- Threads, Concurrency, native threads (confusing so many re-implementations)
- Delegates, sorry I mean arrow functions, oops no I mean lambdas. The features Sun said should not be in the language for years then back pedalled once it realised the foot gun calling out Microsoft for them.
So many attempts at relevance then abandoned, left in the language as cruft, or just ideas that were vehemently not Java, shoe horned in.
And they still don't have the Elvis operator, not for lack of trying though, they do have the abomination Optional instead though, but best practice says DON'T use that for arguments, just return types (but the language permits it anyway).
For newbies, Python is better, Typescript is more accessible for web or serverless, Rust for native...