I'll give ya one that's fresh on my mind since it just came up on
CFDJ-list :

Don't use Evaluate to get values from structures.

Bad:

<cfloop item="key" collection="#struct#">
        <cfoutput>The value of struct.#key# is
#Evaluate("struct.#key#")#<br></cfoutput>
</cfloop>

Good:
<cfloop item="key" collection="#struct#">
        <cfoutput>The value of struct.#key# is
#struct[key]#<br></cfoutput>
</cfloop>

Don't forget that Form is a structure as well, so to 'dump' the Form
results... well, you can use <cfdump> in CF5, or:

<cfloop item="key" collection="#form#">
        <cfoutput>Form.#key# is #Form[key]#<br></cfoutput>
</cfloop>

Another tip:

Never, ever pass the name of a file to be cfincluded via the query
string, ie:

www.foo.com/foo.cfm?f=ray.cfm

where foo.cfm does:

<cfinclude file="#URL.f#">

Why? Imagine what happens when the user changes ray.cfm in their browser
to foo.cfm.


=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email    : [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Deborah Curley [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 05, 2002 4:24 PM
> To: CF-Talk
> Subject: Best Practices
> 
> 
> Hi,
> I'm just wondering what docs y'all would highly recommend 
> regarding CF Best 
> Practices for coding/performance. Maybe a recommendation from 
> Ray? :)  
> Thanks!
> 
> Deborah
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
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