A great example on why to use varScoper

Gurus , Coldfusion Add comments

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

2 responses to “A great example on why to use varScoper”

  1. Gary Gilbert Says:
    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
  2. Pat Santora Says:
    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).

Leave a Reply





Powered by Mango Blog. Design and Icons by N.Design Studio