3 ms·
I don't think passing state through functions calls add cognitive load: it just make it visible. Global state has the same cognitive load, except hidden. If a
by drakmaniso 4y ago
I don't think passing state through functions calls add cognitive load: it just make it visible. Global state has the same cognitive load, except hidden.
If a state is passed through dozens of function calls, this may indicate that it is shared by too many parts of the code, or that it is managed at the wrong layer of the architecture. When using global state, these potential problems are difficult to spot.
- deleted 4y ago[deleted]