Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dependency injection and any othee type of code indirection is evil imo. Anything that breaks the ability to find your way in a codebase with something other than grep brings more pain in the long run than it saves.


> the ability to find your way in a codebase

It's a tradeoff between two different kinds of clarity. Yes, it's harder to see the "whole wiring" without better tools...

But it makes small, encapsulated classes much easier to reason about and develop! You can focus on assuring: "My `Foo` can interact with a supplied `Bar`" rather than dealing with all sorts of crap about what implementation of `Bar` it gets or how that `Bar` instance is configured.


Just grep for "extends InterfaceBeingUsed" and you'll find the implementation just fine.


grep is a that good even for for c++ or dynamic mojo. Java is statically typed and has many ides and tools that understand code structure.


isn't that good




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

Search: