by aidenn0 · 2y ago · 0 comments
I don't understand how this is the case. If anything, an interface is MUCH easier to understand than a variety of functions strung together.
I mean, this is the whole reason we have APIs. If I'm a consumer, I would much rather read and understand the API and its contract than try to read through the code to find out requirements.
I have waded through such code in Java, rather than C#. At least some of it is fighting the language; Java is pretty hostile to writing DI style code.
On top of that, even in languages that are more DI friendly, DI significantly decreases the lexical locality of code that is dynamically very close.
The whole point of specifications is trying to extract the most requirements in the least amount of time. With more "top level" interfaces and tools like DI you can do that, but certainly you can take it too far. A single function, I'd say, is way too far.