OldNESJunkie
Member
Basically a way to force you to have to declare all variables, keeps you from making dumb errors on especially large projects. Yes, you should be doing this in practice anyways, but most people do not.
I guess this is why other languages do variable scoping, because then it is knowable at compile time whether the variable has been declared or not in the current scope, so then variables can be explicitly declared.Unfortunately this is a runtime thing. There is no way to know a variable is declared or not in a script because it has no idea where its being called from, or what instances are being used inside it. This is only known at runtime, hence a runtime crash if you try to read from undefined variables.
So just can't happen I'm afraid....
Some kind of "list variables in project" function could be helpful, yes.There could be some IDE functionality to clarify what variables are being assigned where - or something similar.