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 same reason as in OO languages. Clean separation of startup and runtime. Testability. Ability to avoid duplication and make changes in one place.

> What techniques do you use to make the level of indirection feel like a help, rather than a hindrance, in your codebase?

Separation of concerns/responsibilities always involves indirection. Using something like a free monad would be more indirection. I can't really give any useful advice beyond "factor your app well" and "split concerns/responsibilities at points that make sense"



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: