DEV Community

Discussion on: Are global variables bad?

Collapse
 
dwd profile image
Dave Cridland

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.