News for hackers. Stuff that matters.
Re:Minimalist dependency injection in Python (2021) by ivanche on Wednesday April 13, 2022 @07:58AM (#31013600)
I agree with you completely! As the matter of fact, I prefer this approach. But that is dependency injection at its finest, and something that NewMountain above said is "cognitive overhead" and "indirection".
Re:Minimalist dependency injection in Python (2021) by rodelrod on Wednesday April 13, 2022 @08:31AM (#31013856)
I can't speak for NewMountain but I assume he was talking about using a DI framework or container (e.g. Spring) where dependencies are defined declaratively and the framework handles the instantiation. This is what brings the indirection and the cognitive overhead.