I think there’s a time and place for globals and many scripts are fine to use them. I do prefer scoped variables, classes, objects, etc but sometimes a single global variable has its uses. I was probably influenced by anti-global talk from other programmers and ended up not using them as much. However if you use them, you just have to understand how they work and be mindful.
This article below dives into how globals aren’t technically the issue, it’s the person coding that creates issues by mishandling globals. That might be obvious and the unsaid part of the “never use globals” thought.
https://codestyleandtaste.com/globals-ar...oblem.html
This article below dives into how globals aren’t technically the issue, it’s the person coding that creates issues by mishandling globals. That might be obvious and the unsaid part of the “never use globals” thought.
https://codestyleandtaste.com/globals-ar...oblem.html



![[Image: SIGNATURE.png]](https://i.postimg.cc/xCh3YJrt/SIGNATURE.png)