Should you scope a variable in ColdFusion?

In a previous post I mentioned that you should always scope your variables, the problem with ColdFusion is it does not enforce this.

And maybe it should.

</more>

In Java and .Net c#, VB.net, J# and other languages that I am aware of. At anytime you want to reference something, especially variables you must provide the scope were it is to be referenced.

ColdFusion has always tried to be smart and cycle through known scopes to get to what you might have thought about for your scope. So what happens when the variable you want access to lives in a scope that will be searched for before your scope.

Short answer is stiff shit.

If you don't scope the variable that you mean to want then there is a 90% change you will get what you don't want to get back.

So until Adobe switch it on so that you must provide a scope, you must make sure you do it manually. If you don't then you are at fault, not ColdFusion, the amount of people who complain about ColdFusion is almost always falling into this trap.

So the question is, do you wish to learn or move forward?

If you choose move forward then you are on your way to learning ColdfFusion, and you are more importantly reducing your support calls and emails

So what are you going to do?