That is a valid concern, but there are legitimate uses for globals, particularly "named constants".
It isn't reasonable to pass dozens of "global" and/or static variables to functions, so even if one decides to encapsulate them, how would you suggest that organization be accomplished? A global variable class with one instance passed around everywhere? The disadvantage of that solution is that one must then qualify every usage of the variable with the instance name, or use with statements everywhere they are used. And in order not to have to pass that instance in every function call the one instance name would need to be truly global in order for that to work. That seems clumsy to me, but I am only a novice at this language.
Your further advice and/or comments would be appreciated.
Peter
It isn't reasonable to pass dozens of "global" and/or static variables to functions, so even if one decides to encapsulate them, how would you suggest that organization be accomplished? A global variable class with one instance passed around everywhere? The disadvantage of that solution is that one must then qualify every usage of the variable with the instance name, or use with statements everywhere they are used. And in order not to have to pass that instance in every function call the one instance name would need to be truly global in order for that to work. That seems clumsy to me, but I am only a novice at this language.
Your further advice and/or comments would be appreciated.
Peter