6 ms·
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 arg
by hbrn 3y 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.
- latchkey 3y agoArguing for unit testing, is the worst? Come on, look in the mirror.