2 ms·
> It means that a huge chunk of your code has a huge amount of unnecessary shared state. Can you explain that a little more? Which chunk of code has what shar
by hayst4ck 3y ago
> It means that a huge chunk of your code has a huge amount of unnecessary shared state.
Can you explain that a little more?
Which chunk of code has what shared state, and why is it unnecessary?
- strawhatguy 3y agoBasically, not all the handlers will use every dependency the server (which is the entire program in this pattern) has. Not every handler will use a database, for example. While I may prefer a struct for this instead of separate arguments, I do agree it's useful to capture "the world" as the set of all dependencies, even if some handlers don't use them (yet).