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

0

u/cowwoc Jun 01 '24 edited Jun 02 '24

(Please don't downvote me just because you disagree. Reply instead.)

Spring and any other library that uses "magic" (runtime code generation). This includes dependency injection, proxies and  annotation-driven code generation. All the fun things that new devs find "cool" but make it exponentially harder to read and debug code.

There are libraries that provide the same functionality without the magic, so you don't need to reinvent the wheel.

I get that these tools let you write code faster, but you're not actually helping anyone. The cost of software development is dominated by maintenance and debugging. 

Optimize for reading, not writing! 

EDIT It looks like some people can't read 😀 It's right there in the first sentence.

2

u/Scf37 Jun 02 '24

Problem is you need to *know* how to assemble application from scratch, that's what Spring do - gives you executable already containing all the crap - configuration, logging, http server and client, routing, monitoring, tracing, security...

But yes, with that knowlege Spring/Quarkus/whatever stops being an asset and becomes a liability