re: Are global variables bad? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Phrasing the whole issue from the other end, I think one could argue: It's better to restrict access to mutable data as much as possible. Otherwis...
 

It's more that code with unknown side-effects is bad. Globals are just a common path to weird side-effects. If you have a global that's mutable, then this seems fine as long as there are strict rules about how and when it can change.

code of conduct - report abuse