KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Apparently there's a lot of variety in opinions out there, ranging from, " Never! Always encapsulate (even if it's with a mere macro!) " to " It's no big deal – use them when it's more convenient than not. " So. Specific, concrete reasons (preferably with an example) Why global variables are dangerous When global variables should be used in place of alternatives What alternatives exist for those that are tempted to use global variables inappropriately While this is subjective, I will pick one answer (that to me best represents the love/hate relationship every developer should have with globals) and the community will vote theirs to just below. I believe it's important for newbies to have this sort of reference, but please don't clutter it up if another answer exists that's substantially similar to yours – add a comment or edit someone else's answer.
Tags (comma-separated)
Save Edits
Cancel