4 ms·
Like in procedural languages I write my own harnesses as needed. Because DI adds complexity. And for testing all DI does is make testing easier. You end up ship
by Spearchucker 8y ago
Like in procedural languages I write my own harnesses as needed. Because DI adds complexity. And for testing all DI does is make testing easier. You end up shipping all that complexity or you refactor your ship code. To be fair that might be acceptable to many in a typical corporate environment.
- vietjtnguyen 8y agoWhat do you mean by DI? I find DI is an overloaded term.
- ahansen 8y agoIn this context I believe he is referring to dependency injection.
- vietjtnguyen 8y agoI guess I meant to ask what they mean by dependency injection. A bare version is just passing dependencies as arguments and I can't imagine what is so egregious about that. Maybe they mean something more complicated?
- steveklabnik 8y agoGiven "I write my own harnesses as needed", I read the parent as talking about DI frameworks, not the general concept of DI. https://en.wikipedia.org/wiki/Dependency_injection#Dependency_injection_frameworks https://en.wikipedia.org/wiki/Dependency_injection#Dependenc...
- hacker_9 8y agoWell you are going to need to deal with your dependencies eventually. Unless you are just end2end testing, and not doing any unit tests. In that case good luck finding your bugs when they appear. Or perhaps you write 'if (mode == "test")' everywhere :)