You keep saying variables in the "local" scope. You may want to say the current 
page because there is a "local" scope. In functions if you <cfset var myvar = 
something /> it is in the local scope and you don't attach a scope to it. I 
believe in CF 9 they actually added the local scope for this purpose as well. 

Sent from my iPhone

On May 18, 2011, at 9:59 PM, "Eric Roberts" <ow...@threeravensconsulting.com> 
wrote:

> 
> A good question that was brought up by one of our developers.  When you
> don't scope a var it has to search through the various scopes to find it, in
> order of precedence.  If you are using alocal scope, is there a performance
> hit if you don't scope it since "variables" is implied or does it still go
> into search mode?  Also...is this negated of you use a cfset on the top of
> the page (again...this is only referring to local vars.)
> 
> Eric
> 
> -----Original Message-----
> From: Eric Cobb [mailto:cft...@ecartech.com] 
> Sent: Wednesday, May 18, 2011 01:36 PM
> To: cf-talk
> Subject: Re: scoping
> 
> 
> Here's my take on it:
> http://www.cfgears.com/index.cfm/2010/9/22/The-importance-of-proper-variable
> -scoping
> 
> Thanks,
> 
> Eric Cobb
> http://www.cfgears.com
> Help me make a difference this summer -http://bit.ly/i8dJvQ
> 
> 
> On 5/18/2011 11:51 AM, Eric Roberts wrote:
>> We had a discussion at work as to whether or not we should scope local 
>> vars with the "variables." scope since that is implied in a cfset.  
>> One camp says it is not needed because of the implicit scoping when 
>> using cfset...the other camp says it is better to tack on "variables." 
>> and make it explicit for security and readability.  Any thoughts?
>> 
>> Eric
>> 
>> 
>> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344642
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to