re: Are global variables bad? VIEW POST


I think you're answering the wrong question. Global variables themselves are not bad. Spamming the global scope is, because you'll have stuff bleeding out of your scope or even worse affect other parts of a system.


Again, same problem, define "global" scope. Module scope is often restricted to module. Languages like C++ offer namespace scope as well. Top-level variables in Python don't affect the scope in sub-modules.

Sure, if you're sticking everything into one scope, that's a problem, but I don't it matters what scope that is.


Same difference. It's not about global variables, its about being mindful what to expose.

Well yes, but that's the point of my article. To expose the ideas behind what "global" might mean to draw a learner's attention to the real issues at play.

code of conduct - report abuse