News for hackers. Stuff that matters.
Re:We All Dodged a Bullet by mike_hearn on Tuesday September 09, 2025 @04:04PM (#45188019)
Yes, dependency injection can help although injectors don't have any understanding of whether an object really needs a dependency. But that's not a god object in the sense it's normally meant. For one, it's injecting different objects :)
Re:We All Dodged a Bullet by Groxx on Tuesday September 09, 2025 @09:01PM (#45191754)
to be clear, I mean that the DI container/whatever is "the god object" - it holds essentially every dependency and every piece of your own code, knows how to construct every single one, and knows what everything needs. it's the biggest and most complicatedly-intertwined thing in pretty much any application, and it works so well that people forget it exists or how it works, and carrying permission-objects through that on a library level would be literally trivial because all of them already do everything needed.

hence: doesn't sound too bad

"truly needs": currently, yes. but that seems like a fairly easy thing to address with library packaging systems and a language that supports that. static analysis and language design to support it can cover a lot (e.g. go is limited enough that you can handle some just from scanning imports), and "you can ask for something you don't use, it just means people are less likely to use your library" for the exceptions is hardly a problem compared to our current "you already have every permission and nobody knows it".

Re:We All Dodged a Bullet by mike_hearn on Wednesday September 10, 2025 @06:35AM (#45195740)
Yes, I do agree that integration with DI is one way to make progress on this problem that hasn't been tried before.