I think I know the answer but... is there any way to prevent a global variable from being modified by later-executing ? I know global variables ar
Conventions and good Documentation.
You can prefix your "immutable" variable with two (or more) underscores to indicate that is something not meant to be used by others and to avoid other people's variables clashing with yours.
Maybe creating a 'namespace' like __GLOBALNAMESPACE (Ugly name, I know) and then adding your variables into it (eg __GLOBALNAMESPACE.my_var) and creating a method like this one to retrieve them:
getVariable(string name){
return __GLOBALNAMESPACE[name]
}
Just my 2 cents.