An Architect's View

ColdFusion, Software Design, Frameworks and more...

An Architect's View

varScoper updated

May 20, 2008 · 7 Comments

varScoper, an essential tool for all ColdFusion developers that use CFCs, has just been updated tonight. If you're using it, you'll want to download this update to take advantage of the improvements in this release. If you're not using varScoper... WTF? Are you crazy? Are you not using CFCs? varScoper is an absolutely essential tool for you. Did I say essential?

Tags: coldfusion

7 responses so far ↓

  • 1 Dan Roberts // May 21, 2008 at 5:43 AM

    Hopefully this bug is fixed in CF9[/rant]
  • 2 Sean Corfield // May 21, 2008 at 8:53 AM

    @Dan, it's not a "bug" - it's how the language is designed and changing the behavior would break a lot of code. Sloppy code, admittedly, but it would break it nonetheless.
  • 3 Dan Roberts // May 21, 2008 at 11:30 AM

    I agree with everything you said but there are definitely ways the language could be improved that it does not break code. For example one or both of the following strategies...

    Option 1 (ease pain): Allow var scoping anywhere in where a variable is set or output variable name is passed (query name, index, etc), and possibly default automatic variables (cfhttp, cfcatch, etc) to "var scope". The latter could break some code but very little IMO and this could be a check in the code compatibility analyzer.

    Option 2 (fix): Add attribute to cfcomponent specifying that that function variables default to local scope.
  • 4 Sean Corfield // May 21, 2008 at 11:59 AM

    Those both sound like good enhancements.
  • 5 Jason Sheedy // May 27, 2008 at 3:00 AM

    Sean, couldn't resist having a dig at you on this one. I remember it was only a couple of years ago you were telling everyone that they must be craaazy if they don't var scope all their cfc local variables. (Which I agree with!!) This is the first I've heard of varScoper and to me it just looks like prescription for lazy programming.
  • 6 Sean Corfield // May 27, 2008 at 7:48 AM

    @Jason, I've always been a fan of automated QA tools that help you follow coding guidelines. When I was at Programming Research (PR:QA), I built tools for C and C++ that analyzed source code and reported anything that didn't follow best practice.

    varScoper is just that: a tool that helps check you are following best practice.
  • 7 Dan Roberts // Jun 21, 2008 at 5:16 PM

    I was in the second row at the CFUnited keynote with a big grin as Ben announced the changes for function local variables. Great to hear along with all of the other enhancements in the pipeline.

Leave a Comment

Leave this field empty: