May 20, 2008
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?
Comments
Hopefully this bug is fixed in CF9[/rant]
Posted By Dan Roberts / Posted At
5/21/08 8:43 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.
Posted By Sean Corfield / Posted At
5/21/08 11:53 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.
Posted By Dan Roberts / Posted At
5/21/08 2:30 PM
Those both sound like good enhancements.
Posted By Sean Corfield / Posted At
5/21/08 2:59 PM
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.
Posted By Jason Sheedy / Posted At
5/27/08 6:00 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.
Posted By Sean Corfield / Posted At
5/27/08 10:48 AM
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.
Posted By Dan Roberts / Posted At
6/21/08 8:16 PM
Post Your Comments
Hosting provided by