News for hackers. Stuff that matters.
Re:Minimalist dependency injection in Python (2021) by tored on Wednesday April 13, 2022 @05:14AM (#31012596)
How is DI a cognitive overhead?
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

Re:Minimalist dependency injection in Python (2021) by a3w on Wednesday April 13, 2022 @06:39AM (#31013073)
I have not found a renown C-ish language that is more verbose than Java, so that comparison is not that strongly helpful.
Re:Minimalist dependency injection in Python (2021) by ivanche on Wednesday April 13, 2022 @08:00AM (#31013616)
Do you have any proof of that? 40% is a pretty strong claim.