Glenn Saunders wrote: > But for most CF applications, that degree of optimization is overkill in > comparison to the extra keystrokes it takes to do variables. I find this > code: > > <CFSET variables.a = 1> > <CFSET variables.b = 1> > <CFSET variables.c = 1> > <CFSET variables.d = 1> > <CFSET variables.e = 1> > > much harder to read than > > <CFSET a = 1> > <CFSET b = 1> > <CFSET c = 1> > <CFSET d = 1> > <CFSET e = 1>
I typically don't bother using "variables." when I'm setting local variables, because I think it should be obvious that I'm setting a local variable. I'm not even sure if it's possible to set a FORM variable without scoping it first, so I don't think it's necessary. And, for what it's worth, the Fast Track to CFMX coursebook says to always scope variables, and even that book's examples never have "<cfset variables.myVar = "whatever">". It will always have something like: <cfset myVar = "whatever"> <cfoutput>#variables.myVar#</cfoutput> So, I'm taking that as Macromedia's official recommendation that you don't need to scope setting local variables. :) Scott ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:11:2609 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/11 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:11 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.11 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54