3 ms·
No, they aren't mutable global state, they are paramatrers which is something many languages support: the key difference by design is that their configuration o
by Blikkentrekker 6y ago
No, they aren't mutable global state, they are paramatrers which is something many languages support: the key difference by design is that their configuration only lasts for the dynamic extent of the call.
An environment variable is not mutable global state, for if a process change one, then that change is inherited by it's children, but not by it's parent or siblings, and the change effectively stops existing once the process ends. — that's a very important design change that removes all of the problem with mutable global state.
In that sense, they are more like thread local variables that are inherited by child threads.
A configuration file is much more akin to global mutable state of a system.