News for hackers. Stuff that matters.
Re:Dependency injection in Go with Uber-go/fx by lr4444lr on Sunday February 27, 2022 @10:06AM (#30489074)
Just come out and say it: DI is an anti-pattern. No implementation of it that I'd ever use was doable without a good config file schema, and at that point I have to ask: why not just have a declarative build system in the first place as the modern generation of Devops tools does? DI just burdens and litters code unnecessarily with awareness of build files.
Re:Dependency injection in Go with Uber-go/fx by isbvhodnvemrwvn on Sunday February 27, 2022 @10:15AM (#30489146)
You, as many people here, are again mistaking dependency injection with dependency injection containers. You don't need containers for dependency injection, most codebases can just wire everything by hand without any problem.
Re:Dependency injection in Go with Uber-go/fx by lr4444lr on Thursday March 10, 2022 @09:09AM (#30627029)
What's an example of what you're talking about? Because the delegator pattern is not CI, and that's the only thing that's coming to mind that you might mean.