Yes, but you also have to take performance into consideration

Example

<cfset myString = "">
<cfloop from="1" to="1000" index="i">
<cfif myString EQ "">
Hello
</cfif>
</cfloop>
Execution Time

811 milliseconds
Compared to
<cfset myString = "1"><cfloop from="1" to="1000" index="i"><cfif
len(myString)>Hello</cfif></cfloop>
Execution Time 370 milliseconds


Douglas Brown
Email: [EMAIL PROTECTED]
----- Original Message -----
From: "Sean A Corfield" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, August 15, 2002 10:28 PM
Subject: Re: Best Practices


> On Thursday, August 15, 2002, at 01:16 , Charlie Griefer wrote:
> > To a newbie, <cfif myStringVar is ""> is
> > much easier to comprehend than <cfif len(trim(myStringVar))>.
>
> Yes, which would place the former in the better = more-maintainable
> category...
>
> > So while I do agree that teaching the 'right' way is better than having to
> > unteach a 'wrong' way...remember that a big reason CF is as popular as it
> > is
> > is due to the fact that its learning curve is the bunny hill.
>
> Yes, and with that in mind, we should also remember that our code will be
> read more often than it is written - readability is important and it may
> well be a newbie who has to deal with your code in future...
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to