Skip to content
loading...

re: What is today's "goto"? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Using field injection instead of constructor injection. Well, on the harmful-scale it is not quite on gotos level. Violating the "single level of...
 

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.

 

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.

code of conduct - report abuse