To Lombok Or To DeLombok?

Uncategorized

The Lombok project is a Java library that aims at “spicing up your java.” Started back in 2009, it consists mostly of annotations that can be used on Java classes to generate helpful constructs like getters and setters. It aims at freeing you from writing quite a number of the ceremonial boilerplate code that you sometimes need to write as part of your everyday use of Java. 

Over the past few years however, the evolution of the Java Language changed. With much more frequent, predictable releases and adoption of a good number of “quality of life” features, the Java of today is not necessarily the Java that was whenLombokwas conceived and birthed. This new context has given rise to the very frequent question of what the use of Lombok is in modern Java.

That is a very valid question. But as with almost all things programming, the answer is always “it depends.” The first point is that the use of Lombok is optional. You can use Java as is without Lombok. But then also this depends on what project you are working on. Given the history of Java project upgrades, there are still a significant number of projects on older versions of Java (< 8). Within such a context, Lombok looks appealing because it is exactly those versions of Java that  necessitated the existence of Lombok. Even for projects using newer versions of Java, not every project can take advantage of newer constructs like Records.

So as with all cases, the use of Lombok, or any other third party library for that matter, is always an it depends situation. The real purpose for this blog post however, is the way in which some people express their opinions on the use of the Lombok library in particular. I think it’s OK to be of the opinion that Lombok is not fully needed for modern Java. What I find a little weird is some form of condescension that sometimes accompanies such opinions.

Whether Lombok, or any other library for that matter is useful or not is a matter of personal opinion and project specific. However, I think as developers, it’s important to put things in proper context by not forgetting Lombok was created to ease pain points in previous iterations of the Java Language, at a time when the language evolved quite slowly. So questioning the raison d’etre of the library based on current iterations of Java is not telling the full story. 

We should also not forget to give credit to the many man-hours that other people invest in creating such libraries that make the collective lives of us developers better. You may think Lombok has outlived its usefulness (to you and in your opinion), but that doesn’t mean the library is of no use to other people. I believe we can share our opinions on Lombok without condescension in deference to the developers of those libraries and the many other people that find great value from them. So whether to Lombok, or DeLombok, is “it depends.”

Comments (0)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

Related Posts

How to Run and Scale AI Java Applications in Production: An Overview for Developers with no Machine Learning Expertise 9 minutes
Jakarta EE

How to Run and Scale AI Java Applications in Production: An Overview for Developers with no Machine Learning Expertise

Organizations are increasingly interested in adopting artificial intelligence (AI) and generative AI (GenAI) to improve operations and offer next-generation […]

Payara Qube-Cloud Light banner 4 minutes
Security

Zero Trust Security in Enterprise Java: What it is and How to Implement it

Cybersecurity isn’t just about building walls, fortresses, moats or any other external barrier anymore. Nowadays, it’s important to check […]

4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]