We've addressed some, but not all of these issues, so it's still best to
avoid using reserved keywords as variable names. To quote from the CFMX 6.1
documentation:

    "The following list indicates words you must not use for ColdFusion
variables, user-defined function names, or custom tag names. While some of
these words can be used safely in some situations, you can prevent errors by
avoiding them entirely.

    - Any name starting with cf. However, when you call a CFML custom tag
directly, you prefix the custom tag page name with cf_.
    - Built-in function names, such as Now or Hash
    - Scope names, such as Form or Session
    - Operators, such as NE or IS
    - The names of any built-in data structures, such as Error or File
    - The names of any built-in variables, such as RecordCount or CGI
variable names
    - CFScript language element names such as for, default, or continue"

 
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/express2.htm#wp271196
1

So, yes, BlueDragon is sometimes inconsistent, but so is CFMX (at least the
documentation), since they first tell you that you "must not" use reserved
keywords for variables names, etc., and then turn right around in the next
sentence and tell you that "some words" can be used in "some situations".

Shouldn't it be all or nothing--that you can always use reserved keywords as
variable names or that you can never use reserved keywords as variable
names? Or, at least tell us when they can and cannot be used safely instead
of making vague references to "some words" in "some situations"? How are you
supposed to know?

BlueDragon was originally very strict and prevented use of keywords in all
situations. However, we've gradually loosened things up a bit; two examples:

  - If you have a database column name that's the same as a scope name,
"URL" for example, you can reference it within CFOUTPUT without qualifying
the reference with the query variable name.

  - You can create a variable with the same name as one of the built-in
scopes, as long as you qualify the reference, such as "variables.request".

Note that in most modern programming languages (Java, C/C++, C#, etc.),
reserved keywords are just that--they're reserved for use by the compiler.
As for upgrades introducing new keywords that break old code--that's just
something people using those languages learn to live with; for example, JDK
1.5 introduced the new "enum" keyword that broke people's old code. That's
just the way it is.

Vince Bonfanti
New Atlanta Communications, LLC
http://www.newatlanta.com
 

> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 24, 2005 3:40 PM
> To: CF-Talk
> Subject: BlueDragon was RE: serialize cfc
> 
> Hey Vince -- off-topic, I just had a quick question -- has 
> there been any progress or plans for progress on the 
> explicitely-scoped keywords bug that's been reported in 3-5 
> different bugs in the BD bugbase?
> Seems like a silly thing, but it's been the larger issue 
> that's prevented me doing more testing on BlueDragon for months now.
> 
> Bug #867 and 868 ... one is labelled a cfml engine bug, the 
> other a documentation bug...
> 
> Silly thing is the BD engine isn't even internally consistent 
> on this point -- or wasn't last time I tested it -- the same 
> excplicitly scoped variable will produce an error in cfscript 
> but not when a cfset tag is used. (There's a comment about 
> this with an example on bug
> 868.) And I know I've seen at least 2 other bugs in the 
> bugbase in the past both directly related to this issue, but 
> the only response I've ever gotten on it is "don't use keywords".
> 
> Part of the problem is that "don't use keywords" doesn't help 
> me to future-proof my code. If I use CFMX and I declare a 
> variable request.dim if the word "dim" is later added as a 
> keyword (like the var keyword and several other keywords have 
> been recently added), my code will work fine in CFMX, but 
> using blue-dragon, an upgade to a new version with the new 
> keyword would break my code.
> 
> Anyway, just curious.
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:196580
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to