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?

2

u/Turbots Jun 01 '24

I've been consultant for 10 years, presales for 5 and now freelance developer again, been in many small to very large companies on very shot/small to huge projects, I've seen them all.

In my experience, bigger companies cargo cult harder on the industry standards of 10 years ago, and have more middle mgmt, almost by design. Most of them have senior architects that only sit in their ivory tower and interfere too deep with coding practices.

Only a handful of enterprise architects actually focus on their main goal: to make sure that the overall IT architecture of the company is stable, sustainable, well integrated and still able to change rapidly.

Technical managers should not interfere with architecture nor with coding best practices. In my head, a technical manager is people manager first and takes care of the overall career development of his people. He makes sure they are working on the thing that is best for the company AND the people, both project wise as on the level of personal development. He needs to make sure his people have the right tools and opportunities to grow within the company. I've had some of those in my career as well, and they really motivate and propel you forward.

→ More replies (4)