Hacker News new | ask | show | jobs
by fivea 1530 days ago
> I stopped reading right here:

Me too. The author shows a deep misunderstanding and even obliviousness to testing, particularly from a practical point of view, that takes any credibility from any argument listed in the article.

It's even perplexing how the best example the author could come up with was this absurd chain of strawmen that a) it's impossible to test code that uses instances of HttpClient, b) dependencies used in dependency injection "serve no practical purpose other than making unit testing possible."

There are plenty of people talking about unit tests. This article is not one of which justifies any click.

1 comments

That person never wrote portable code. I wouldn't envy anyone maintaining or refactoring it to support more platforms.

Main reasons to have dependency injection is to have properly runtime switchable code with less shared state. That it makes testing easier is a side effect.