[thelist] ColdFusion: Nested pound signs

.jeff jeff at members.evolt.org
Tue Nov 13 22:05:38 CST 2001


ray,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Raymond Camden
>
> Just to be anal - you don't need to use single quotes.
> This is fine as well:
>
> <CFSET Sentence = "The Length of blah is " & Len(...)>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

i prefer to use double-quotes around strings because of the way cf studio
highlights them versus strings wrapped with single-quotes.  wrapped with
double-quotes, the string is blue.  wrapped with single-quotes the string is
red, causing it to blend in with all the red coldfusion tags.

because of this syntax highlighting, i also prefer to not embed variables
within strings, choosing instead to break out of the string and concatenate.
for example, i wouldn't do this:

<cfset fullname = "#form.first_name# #form.last_name#">

i would do this instead:

<cfset fullname = form.first_name & " " & form.last_name>

with the syntax highlighting i know at a glance that the value of the
variable fullname is made up of other variable values separated by a string
made up of a single space and concatenated together.

just my 2c,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list