r/java • • Jun 01 '24

What java technology (library, framework, feature) would not recommend and why?

165 Upvotes

464 comments sorted by

View all comments

221

u/Turbots Jun 01 '24

Lombok. It can cause quite a few unexpected problems with generated code, like adding a toString that automatically prints out all fields in the class, even if some of those are being lazily loaded.

I don't like it because it gives junior developers the feeling they can cut corners and write much less code, without knowing what the annotations do. And most of the features that Lombok offered are now part of the Java language.

It also adds unnecessary requirements when developing like IDE support, additional settings in maven/gradle etc..

4

u/Inevitable_Detail193 Jun 01 '24

Yeah agree. In my current project (extern consultant) we are forced to use it since management thinks its best and we have fewer lines of code. We developed a very small REST API with two domain objects. It was more expense to integrate lombok to our IDEs and combine the Jackson annotations with the lombok ones than simply let the ide generate getters and setters.

Also in another webservice i spend hours debugging some errors caused by unwanted Code generation with lombok. Also it is harder to explain to junior devs, who should first understand the concepts with Tostring, equals etc.

14

u/Turbots Jun 01 '24

Management should never impose rules on technical decisions. They can decide on business outcomes like cost, functionality, time to deliver, performance or response times of an API, etc...

They should not dictate how the engineering team gets to those outcomes.

It's important as engineers to push back to management on these things using rational arguments, providing numbers so you can change their minds over time. Even in a consultant position, I would even say, especially in a consultant position! Otherwise you're just reduced to a mindless drone following orders. An expensive at that.

5

u/repeating_bears Jun 01 '24

I think they meant technical management, like STL 

1

u/Turbots Jun 01 '24

Senior Tech Lead?

Yeah , so called Enterprise Architects that haven't coded in years but make all the rules on coding is VERY bad for your engineering practices. Thought that was already established for many years, but I see them a lot still in big companies.

5

u/repeating_bears Jun 01 '24

I meant software team lead. Sorry, thought that acronym was more well-known than maybe it is. As in a semi-hands-on person who coordinates a small team. You never had a competent technical manager?

→ More replies (5)