On Mar 19, 2004, at 4:33 PM, Barney Boisvert wrote:
<cffunction name="save">
  <cfargument name="id" type="string" required="false" default="" />
  <cfargument name="name" type="string" required="true" />
  ...

<cfif len(id) GT 0>

What if "" is a valid valid for id? That's why encoding two pieces of information in one variable is bad practice (and why, for example, a function that returns an integer value should not reserve one value for 'error' when all other values are valid!).


You shouldn't base behavior on whether an argument has a default value but on whether or not the argument is truly present (in my opinion).

Regards,
Sean

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to