Jul 21
Mike Schierberl just posted a great example on why to user varScoper. It's a must read for those who have not fully understood the reasoning behind var scoping.
You can catch the post here:
http://www.schierberl.com/cfblog/index.cfm/2008/7/21/Thread-safety-and-the-var-scope--live-example
Jul 22, 2008 at 2:20 AM Hi Pat,
I also have a good example of what can happen when you don't var scope queries in components.
http://www.garyrgilbert.com/blog/index.cfm/2008/7/21/Var-Scoping-Queries
Jul 22, 2008 at 6:31 AM Nice Gary,
Every little bit help in regards to getting an understanding about var scoping. It amazes me sometimes how developers can put var scoping on the back burner instead of taking the 10-15 seconds to var scope a given variable. It's kind of like the "until it really effects me and my app I am just going to leave it alone". Ya know?
Your example is a great one. I was at a Saccfug meeting (Sacramento) just recently and many people did not know that you need to var scope variable that pertain to certain functions in cf (loops, etc).