Hacker News new | ask | show | jobs
by xentronium 4476 days ago
RE: Developing Decoupled Code

Extra complexity cost is insane and probably not worth it. Basically you move all your crazy stubbing and mocking out of test code and into application code. Do not do this unless you really, really need this kind of dependency injection.

1 comments

Back in the day, we laughed at people who stuffed all their code into button click handlers.

Now, we mock people who don't.

My, how different the web is!

That's a straw man. I see how you made it up for a joke, but it's still confusing. "Don't overengineer" is not the same as "stuff all your code into button click handlers".