Plain global state is not that bad actually. What people do to fix the global state made things worse, and IMO OO is also a terrible attempt.
Mutate coarse-grained or global state is pretty much similar to functional programming approaches. The global state is a big tree, and there are functions designed for this type, there are also functions and types for every fraction of the tree. It's straight forward, elegant, and extensible.
It's basically what Alan Perlis said in SICP: "It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures."
The only difference is just functional programming always transact the whole tree instead of mutating it, since they use immutable algebra data type.
It's not far from what Redux/Erlang process/Haskell ST Monad etc does.
IMO OO makes it more obscure and too subjective compared to this approach. It makes people lost the whole picture very quickly, and then accidental complexity comes in play in every corner.
Mutate coarse-grained or global state is pretty much similar to functional programming approaches. The global state is a big tree, and there are functions designed for this type, there are also functions and types for every fraction of the tree. It's straight forward, elegant, and extensible.
It's basically what Alan Perlis said in SICP: "It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures."
The only difference is just functional programming always transact the whole tree instead of mutating it, since they use immutable algebra data type.
It's not far from what Redux/Erlang process/Haskell ST Monad etc does.
IMO OO makes it more obscure and too subjective compared to this approach. It makes people lost the whole picture very quickly, and then accidental complexity comes in play in every corner.