Global Variables


This doesn’t really fit anywhere else, so I thought I’d introduce it here… I’ve always been taught that global variables are a “bad thing” ™, see: “Global Variables Are Bad” for all sorts of very compelling reasons, and yet the tutorials and examples I’ve seen all use them willy nilly, and never reference this fact.

How do more experienced AI coders deal with global variables? Do folks not see a problem with them?


I’m not against them, thing is you should use them wisely: use global var when really needed (sometimes you can’t really do things otherwise) and in every other case use local var. Unless you stuff your app with hundreds of globals I don’t really see a problem.