Shannon,

There is likely a speed difference because CF does not have to introspect
and evaluate the string any further with the second option... but I would
say you would need a really really long string to see the difference  :)

Still, I'd have to say  I favor the second in most cases. I only use the
first when I have a lengthy strting in cfscript and most of the string is
constant. The second approach is semantically descriptive of what is
actually going on here (a concat operation)... so I like to see that in my
code. I don't really have any objection to the former approach however so
I'd say that yes it is mostly a style difference. I would also have to say
that the first approach is kind of how cfsavecontent works and I use that
all the time for XML or content etc.

-Mark

Mark A. Kruger, MCSE, CFG
(402) 408-3733 ext 105
Skype: markakruger
www.cfwebtools.com
www.coldfusionmuse.com
www.necfug.com



-----Original Message-----
From: Shannon Rhodes [mailto:shan...@rhodesedge.com] 
Sent: Monday, January 03, 2011 8:10 AM
To: cf-talk
Subject: Concantenate vs Pound Signs within Quotes


Is it merely a stylistic difference between

<cfset myvar = "What do you think of #this#?" />

and

<cfset myvar = "What do you think of " & this & "?" />

Or is there a speed advantage to the latter which cancels out any increased
readability in the former?

Thanks! 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340347
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to