Hacker News new | ask | show | jobs
by tored 1535 days ago
How is DI a cognitive overhead?
2 comments

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/).

The extra levels of indirection mean more code. Python programs are about 30-40% shorter than Java equivalents.

More code = more cognitive overhead

I have not found a renown C-ish language that is more verbose than Java, so that comparison is not that strongly helpful.
Do you have any proof of that? 40% is a pretty strong claim.