3 ms·
> Mutable global state is evil. Friends don’t let friends use mutable global state. Throw away your CPU and RAM then.
by maep 2y ago
> Mutable global state is evil. Friends don’t let friends use mutable global state.
Throw away your CPU and RAM then.
- titzer 2y agoAnd disks. And the cloud. Or basically, you know, computers.
- layer8 2y agoThe universe, you mean.
- kibwen 2y agoDon't threaten me with a good time.
- incrudible 2y agoAh yes, the cloud where we all happily share compute resources without any restrictions to avoid stomping on each others toes.
- forrestthewoods 2y agoI can not possibly roll my eyes hard enough. Go ahead and write lots of mutable global statics. But when your program crashes randomly and you need my help to debug and it is, once again, a global mutable then you have to perform a walk of shame.
- incrudible 2y agoYour CPU has an MMU in order to (among other things) let the OS prevent mutable global state.
- snowfarthing 2y agoThere are certainly levels of the abstraction pyramid where mutable global state is unavoidable; however, it shouldn't be too difficult to get to a point where we have enough abstraction so that we don't need to worry about mutable global state for what we do. And even if those abstractions can't be 100% effective, we'd go a long way to achieving the desirable results of getting rid of it, if we just develop the mindset of avoiding it if at all possible, excepting for very rare instances where it's needed as a last resort.