DEV Community

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

Collapse
 
fnh profile image
Fabian Holzer

Using field injection instead of constructor injection. Well, on the harmful-scale it is not quite on gotos level.

Violating the "single level of abstraction" principle within modules.

Recklessly introducing thirdparty libraries. Or the other extreme: the infamous "Not invented here" syndrome. Which in some sense is a form of procrastination: "Hey boss, before I write the app, I've first got to write my own crypto/auth/orm/di/you name it..."

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.