> Brings up an interesting point.  During my tenure of client-server
> development (VB,PowerBuilder,C) we always prefixed our variables with
scope
> and type.  For example, ls_name would be a "local" variable of type
> "string".  However, in all the cf-talk threads, and books I rarely noticed
> this technique used.  Is there a reason for this?  The type may not be as
> useful, but the scope prefix would seem to eleviate the problem of
multiple
> scoped variables with the same name.

I'm a big fan of prefixing variable names with a type identifier
(strSomeString, intSomeInteger, booSomeBoolean, etc).  I started doing this
when I was doing VBA programming and got hooked on the idea. Since CF is a
"typeless" language many people don't feel the need to do this, although I
feel that it helps tremendously in code maintenance.

As for including the scope prefix, the only prefix that I leave off
sometimes is "Variables." because it is the default scope that CF looks in.
Even within a CFOUTPUT QUERY="" block I prefix my variables with the name of
the query both because its more efficient.

Basically, you should ALWAYS scope your variables because then you're not
forcing CF to loop through scopes looking for your variable: a time
consuming and potentially error causing process.

Regards,
Seth Petry-Johnson
Argo Enterprise and Associates

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to