Hacker News new | ask | show | jobs
by maep 512 days ago
> Mutable global state is evil. Friends don’t let friends use mutable global state.

Throw away your CPU and RAM then.

4 comments

There 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.

Your CPU has an MMU in order to (among other things) let the OS prevent mutable global state.
I 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.

And disks. And the cloud. Or basically, you know, computers.
Don't threaten me with a good time.
Ah yes, the cloud where we all happily share compute resources without any restrictions to avoid stomping on each others toes.
The universe, you mean.