4 ms·
The main reason I have a distaste for dependency injection is because of this, promotes separating code into multiple places and over-abstracting things, making
by DanielHB 3y ago
The main reason I have a distaste for dependency injection is because of this, promotes separating code into multiple places and over-abstracting things, making code hard to follow. Most of the times it is not worth the trade-off.
Doing module mocking for unit tests instead of dependency injection in runtime code is almost always a better idea in my opinion. Dependency injection was invented for languages that can't do module mocking.