Hacker News new | past | comments | ask | show | jobs | submit login
Why Dependency Injection Is EVIL? (Updated 21st February 2015) (tonymarston.net)
2 points by superasn on March 24, 2015 | hide | past | favorite | 1 comment



"If you know you will never change the implementation or configuration of some dependency, there is no benefit in using dependency injection.".

It all boils down to this.

Here's the catch, though: with dependencies, it is really, really hard to know you will never change the implementations. In most languages, implementing dependency injection is so trivial that it is always worth it. The work associated with changing implementations that aren't built with some form of loose coupling is in most cases, non-trivial.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: