What you say is true (only a programmer can know how a variable is
used), but a warning generated if a variable is not explicitly scoped
would help find the little oversights that can be a real pain to track
down.
I am of the opinion that all warnings in a program (java, for example)
should be tracked down and eliminated, even if the "fix" is just to
disable the warning on the one method/line that is complaining (because
it is "right"), but every one of them should be examined. For ever 100
warnings I get rid of (in a large java program, say) I might find one
bug waiting to happen, and that one bug is worth fixing.
Thanks
Mark
-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 09, 2007 8:15 PM
To: CF-Talk
Subject: RE: CF Coding Standards
> What I would find more interesting is something approaching a "coding
> style validator" for important things, like "var"ing local variables
> in functions and always scoping variables properly (to the degree that
> I would want), checking for cfparam tags for url, form, and attribute
> variables, etc.
Those are functional changes, not stylistic changes. You won't find much
to help you with functional changes - that's your job as a programmer.
For example, you might have a reference to a variable within a function.
Should it be local? Only you can answer that - it could be a reference
to a variable that actually exists outside the function (this is
relatively common in CFC methods, for example).
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta, Chicago,
Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290736
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4