3 ms·
> The Context Dependency Injection stuff was so great, allowed creating things on demand and in different scopes of demands so easily. OP is currently working
by zahlman 1y ago
> The Context Dependency Injection stuff was so great, allowed creating things on demand and in different scopes of demands so easily.
OP is currently working in Python, so that seems to me like a wild justification to go back to Java.
Elsewhere ITT someone is praising Java for having the ability to keep large codebases organized and comprehensible. But my experience of Java was that the overall boilerplate, focus on classes, manifest typing, functions not being first-class objects, etc. make the codebase large. Then it gets ballooned even further with systems designed to introduce dynamism into a fundamentally static language.
As I've pointed out in other threads before, "dependency injection" in a dynamic language is approximately a fancy term for "passing an argument to a function". Oh, but it already looks for a global and you don't want to rewrite it for some reason (even though your compilation step is trivial)? That can be addressed with a pretty small decorator. It seems like a lot of why these frameworks exist in Java is so you can reuse implementations of "design patterns" that fix problems Python doesn't have in the first place. By the way (since I just checked it out of curiousity), the code for the Spring framework is comparable in length to the entire Python standard library, including tests.