Im reading a lot about "PUBL vars a bad" and so on .. but exactly Why!?
Just want to initiate a Talk so everyone can understand why or why not!?
there was a thread lately stating that most people say
- Dont use PUBL Vars
- If you really need em use a Publ Obj. and add the VARS you need to this Object
But now !?!? what is the difference !?
If you need a PUBL VAR you should declare all PUBL Vars in a separate PRG File so you always know which vars you have .. and maybe have some && description added there you use these.
So if you use the OOP approach you should do the same having a PRG with the Create Obj + the needed ADDPROPERTY ...
its very bad to delare PUBl stuff somethere down the Code anyway ...
so where is the difference !?
I know there might be cases there you use a common Name as a Variable which was declared as PUBL before .. but than that is the FAULT in the Declaration ... everyone should know that one should not use common names a PUBL Vars .. like "Count"
And if you use Vars in a Local function declare them LOCAL.[ALWAYS!!]
So in my opinion the Problem is not PUBL Vars in any way its the way you use em which makes it bad later or might lead to unexpected results ...
Another Comment:
where is the difference between:
oMyVars.checkusedbf
and
MyVarscheckusedbf
meaning you put a special short word before every PUBL Var so you cant mix it up with Local.