What's your perspective on this: Windows apps, typically have a global "App" object. Also, sometimes there's a global thing representing something like "the keyboard" or "the screen". Are there really NO circumstances under which global variables might be acceptable? Even in a browser programming context there's usually "the window" as a global, universally accessible thing. I'm wondering if it's a little more gray than "global variables are always bad"?
Yeah. There are still a lot of global variables being use and are still useful. But I think global variables are frequently use to declare constants inside the app. Like App object in Windows applications.
What I mean by global variables here are the one that is being declared/created by the programmer.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What's your perspective on this: Windows apps, typically have a global "App" object. Also, sometimes there's a global thing representing something like "the keyboard" or "the screen". Are there really NO circumstances under which global variables might be acceptable? Even in a browser programming context there's usually "the window" as a global, universally accessible thing. I'm wondering if it's a little more gray than "global variables are always bad"?
Yeah. There are still a lot of global variables being use and are still useful. But I think global variables are frequently use to declare constants inside the app. Like App object in Windows applications.
What I mean by global variables here are the one that is being declared/created by the programmer.