View comments | RSS feed
Contents > Developing ColdFusion MX Applications > Writing and Calling User-Defined Functions > Creating user-defined functions > Rules for function definitions Good argument naming practice PreviousNext

Good argument naming practice

An argument's name should represent its use. For example, the following code is unlikely to result in confusion:

<cfscript>
   function SumN(Addend1,Addend2)
   { return Addend1 + Addend2; }
</cfscript>
<cfset x = 10>
<cfset y = 12>
<cfoutput>#SumN(x,y)#<cfoutput>

The following, similar code is more likely to result in programming errors:

<cfscript>
   function SumN(x,y)
   { return x + y; }
</cfscript>
<cfset x = 10>
<cfset y = 12>
<cfoutput>#SumN(x,y)#<cfoutput>

Contents > Developing ColdFusion MX Applications > Writing and Calling User-Defined Functions > Creating user-defined functions > Rules for function definitions Good argument naming practice PreviousNext

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


sanaullah said on Aug 29, 2003 at 8:42 AM :
this line
<cfoutput>#SumN(x,y)#<cfoutput>
should be like this
<cfoutput>#SumN(x,y)#</cfoutput> must close the cfoutput tag

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/udfs10.htm