top | item 37527835

(no title)

hbrn | 2 years ago

Apologies, but such mindset is the essence of the worst programming traits.

> The code that is more easily unit testable, is the code I care about.

Author argues that his code is more readable. Sounds like you're saying that being unit-testable is more important than being readable.

> Neither example is easily tested.

Only if you're a unit testing zealot. Integration/E2E testing is easy for both.

> Neither support injecting the dependencies, which make mocking really difficult.

Mocking is not a virtue. Also, if mocking is the sole reason you're using DI, you're doing it wrong.

discuss

order

latchkey|2 years ago

Arguing for unit testing, is the worst?

Come on, look in the mirror.