DEV Community

Discussion on: Are global variables bad?

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Yes, context is important. It's what I was hinting at when I mentioned a micro-service architecture, but didn't want to get into too many other options.

I also mentioned briefly that the "type" of the variable is important as well. This can also depend on domain, and threading, but certain types, like fundamentals, are a bit safer as globals than large classes, or pointers.