Hacker News new | past | comments | ask | show | jobs | submit login

I'm still very much pro DI as a concept.

I don't think DI itself really causes any problems, the solutions designed to save you from a little bit of boilerplate code, cause the problems.




Are you pro DI as in "Dependency Injection", or pro DI as in "Dependency Inversion Principle"?

DIP is a good way to build software. When injecting dependencies becomes so complex you need a framework or need a separate concept of DI (sans P) then I think something has gone wrong, incidental complexity has won.


I mean the original statemement from the perspective that only certain languages/environments (Java, etc.) propose DI as a solution. E.g. in my current language of choice, C++, DI is nowhere to be found.


> in my current language of choice, C++, DI is nowhere to be found

STL, for example when passing explicit allocators. You can even call any higher order function using dependency injection.

And of course there are C++ codebases that look like Java - the pattern book works with C++ too.


C++ has constructors doesn't it?


And higher order functions.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: