DEV Community

Discussion on: What is today's "goto"?

Collapse
 
jdsteinhauser profile image
Jason Steinhauser

Using field injection instead of constructor injection.

SO MUCH THIS. It gets so much more difficult to reason about your program.

Recklessly introducing thirdparty libraries. Or the other extreme: the infamous "Not invented here" syndrome.

Unfortunately, I've been bitten on both of these in the past. Do you know how many times I've had to write BLAS (basic linear algebra subprograms) libraries because "we think we have a slightly better way to do these"? Thankfully, I didn't have to deal with frivolous 3rd party libraries like LeftPad, but I have used React or some React components when they were definitely not necessary.

Collapse
 
alainvanhout profile image
Alain Van Hout

It gets so much more difficult to reason about your program.

Could you elaborate on that, because I've never seen field versus constructor injection have any effect except for PO(J)O unit testing and the amount of code.