Why Global State is Evil?
1. Hard to Debug:
Imagine debugging an unknown program: You find that function A behaves a certain way for certain input parameters, but sometimes it works differently for the same parameters. You find that it uses the global variable x.
You look for places that modify x, and find that there are five places that modify it. Now good luck finding out in what cases function A does what...
2. Inflexibility
2. Poor testability
Same as Singleton
3. Concurrency Issues
Same as singleton