DEV Community

Discussion on: Why are global variables bad?

Collapse
 
galvao profile image
Er Galvão Abbott

What I've meant with my comment is that global variables exist for a reason. One shouldn't be afraid to use them, when necessary.

It's dangerous to make such affirmations such as "thing X is bad for you" when it comes to programming, since this can even hinder the development process.

Let's try again: "When possible you shouldn't use global variables". That, for me, is a much more sensible way to put it instead of all the FUD we see going around in this industry.

And yes, there are a few source codes where I do use global variables.