4 ms·
It seems the encouraged method is IoC these days, and that's just dreadful. IoC/Dependency resolution all over make it insanely hard to reason about code withou
by bpicolo 9y ago
It seems the encouraged method is IoC these days, and that's just dreadful. IoC/Dependency resolution all over make it insanely hard to reason about code without running circles through the codebase.
For me, IoC seems invented almost entirely to make up for how difficult testing can be in particular languages. Which, sure, making up for shortcomings as good, but the necessity to use IoC for it feels bad.
- GordonS 9y agoThis is how I felt about IoC as a junior dev 15 years ago, before I'd actually used it myself. Nowadays the benefits are clear to me: more modular, testable code, and also lifecycle management. Give it a try, you may well change your views.
- bpicolo 9y agoI've used it a fair deal. I've found I prefer languages that don't require IoC to make code testable. I agree that it's one of the sanest options when it's required, I just think that language design should incorporate testing ergonomics from the start.