Re:Minimalist dependency injection in Python (2021)
by tored on Wednesday April 13, 2022 @05:14AM
(#31012596)
How is DI a cognitive overhead?
[ Parent
| on HN ]
Re:Minimalist dependency injection in Python (2021)
by mkl95 on Wednesday April 13, 2022 @05:40AM
(#31012728)
OP mentioned Python, and I agree that it's a cognitive overhead in that particular case, in the sense that it's an abstraction that can be avoided.
If you are using something like Java or C++ then it's easy to see the benefits (some C++ developers would disagree though, read https://accu.org/journals/overload/25/140/pamudurthy_2403/).
Re:Minimalist dependency injection in Python (2021)
by pydry on Wednesday April 13, 2022 @05:59AM
(#31012856)
The extra levels of indirection mean more code. Python programs are about 30-40% shorter than Java equivalents.
More code = more cognitive overhead