Why Isn't There a Local Scope?
I was giving a presentation today on CFC's, and was explaining the difference between the variables scope, the 'local' scope, the this scope, and the arguments scope. It was incredibly hard to explain, mostly because an unscoped variable in a CFC function can refer to either a local, variable-scoped, or arguments-scoped variable.
It made me think, why didn't they just create another default scope named 'local'?
However, I realize the ColdFusion development team has some noggin-horsepower, so I'm sure there is a good reason. I just can't think of it.
Comments
-- Adam



I cover this in depth in my "From User-Defined Functions to ColdFusion Components" chapter in the latest FAQ-U (small plug). :)
Posted by: Michael Dinowitz at November 30, 2006 5:20 PM