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

> I'm very curious to hear from someone who likes DI in a non-OOP language - why?

The alternative to DI is keeping dependencies in a global state (global variables, singletons, whatever) and that is a maintainability nightmare for any codebase above a certain size. I don't think that it matters if the language is OOP or not, the issue is the same.



modules just do it better




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: