Dependency Injection Debate
This cluster centers on debates about the value, implementation, and necessity of dependency injection (DI) in programming, including comparisons to constructors, manual DI, modules, and frameworks across various languages.
Activity Over Time
Top Contributors
Keywords
Sample Comments
Disagree on using a lib? cause I guess doing manual DI is still DI.
Your comment is unclear. Are you encouraging people to NOT use DI frameworks, or using them only with constructor-based injection?
I've never quite understood the appeal of Dependency Injection. What's wrong with just using constructors?
Could you provide a concrete example of a good use of DI?
How do module systems make IOC and DI obsolete? What's the argument?
Most DI frameworks you explicitly pass things in via the constructor. I don't get it.
Witness the power of dependency injection
Dependency injection separates discovery from dependency. It's neither good nor bad but can be useful as well as abused beyond ad nauseum. End of story.
Dependency Injection is a way to achieve Inversion of Control - meaning the consuming modules aren't concerned with the implementation or instantiation of their dependencies. Dynamic languages have less of a need for Dependency Injection than statically typed languages, but things like instance lifecycle management and policy injection are still very much relevant for good modular design.
I don't understand what you're describing has to do with dependency injection. See https://news.ycombinator.com/item?id=43740196.