Hacker News new | ask | show | jobs
by nicksellen 4090 days ago
The conclusion is a lot more moderate than the title, the author actually uses dependency injection:

While DI has benefits in some circumstances, such as shown in the Copy program, I do not believe in the idea that it automatically provides benefits in all circumstances. This is why I consider that the application of DI in the wrong circumstances should be considered as being evil and not a universal panacea or silver bullet. In fact, in the wrong circumstances it could even be said that Dependency Injection breaks encapsulation. Although I have found some places in my framework where I have made use of DI because of the obvious benefits it provides, there are some places where I could use DI but have chosen not to do so.

I think using the word evil is far too dramatic, evil should mean do not ever use.

2 comments

Well at least he didn't title it "Dependency Injection Considered Harmful".
Articles Titled Considered Harmful Considered Harmful
So all he's saying is that using DI wrong is wrong?