I agree with all of your comments.

Thanks 

-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 16, 2005 9:57 AM
To: CF-Talk
Subject: Re: Equations Between #s - Good or Bad?

> Is there anything wrong, either now or in the future, with doing 
> something like:

> <cfoutput>#2-1#</cfoutput>

> rather than:

> <cfset x = 2 - 1>
> <cfoutput>#x#</cfoutput>

> The only thing I see is that it makes the code a bit harder to read.

I don't personally prefer it ... partly for the sake of legibility
although not everyone agrees that it's harder to read... in general, I
prefer for the contents of the # symbols to be "encapsulated"
syntactically... so either a single variable or a function call imo is
preferable. Then again I don't usually find myself with situations in
which I would be performing math in the middle of a display. I usually
have performed all my math prior to display. At least -- that's the case
when I'm working on my own projects.

I'm not sure if this carries any weight for you, but a single variable
or function call is probably also closer to what's generally available /
done with other languages. I.e. in some systems variables can be
injected into a string using %variablename ... it's generally not
available for them to specify %var1-%var2 and have it inject "1"
instead of injecting "2-1".

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:209675
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