News for hackers. Stuff that matters.
Re:You probably don't need a dependency injection framework by surgical_fire on Monday May 26, 2025 @04:23AM (#44095229)
> instantiate your dependency tree with `new` or whatever in the root of your app

Then you are doing dependency injection, just replacing the benefits of a proper framework by instantiating everything at once the root of your app.

Whatever floats your boat, I guess. Thankfully I don't need to work on your code.

Re:You probably don't need a dependency injection framework by jen20 on Monday May 26, 2025 @07:22AM (#44096290)
Indeed, you get the benefits of dependency injection, without the complexity and shit show of a truth-obscuring framework.

I think we can both agree that it’s good we don’t need to work with each other though.

Re:You probably don't need a dependency injection framework by surgical_fire on Monday May 26, 2025 @11:15AM (#44098267)
> truth-obscuring framework.

That you think that a DI framework obscures anything is just a developer smell.

Having worked with multiple of those, it was always pretty clear what was being instantiated and how.

Re:You probably don't need a dependency injection framework by jen20 on Monday May 26, 2025 @11:55AM (#44098595)
Well in that case, every Java DI framework I’ve encountered has that smell. Spring, Guice, all of them. Same in C#. Perhaps it’s an enterprise (in the pejorative) thing.

It is interesting to note that these frameworks are effectively non-existent in Go, Rust, Python - even Typescript, and no one complains you can’t build “real things” in any of those languages.