Pete's example of a multi-argument function call syntax is a clean one but one 
that few people use. Most of the time they do something like this:

var isValidEmail = checkEmail("[EMAIL PROTECTED]","secondArg","more than 2 
args");

which is perfectly legal, but far from informative. If you are going to use the 
function call style, then I suggest using the named pairs as he does. It is 
cleaner, tigher and only results in a little extra typing. 

My preference for CFINVOKE comes from the same desire for clean code. In the 
long run, a little extra time in writing the code cleanly will save you.
(that is, save you time, life, hair, etc.)

>Pete,
>
>As an alternative, we never use CFINVOKE.  (But if we did use
>CFINVOKE, we'd only use CFINVOKE).
>
>In order to keep code consistent we always call the functions in the
>same manner wether it has 0 or 10 arguments.  If we have more than 2
>or 3 arguments start using whitespace to your advantage.  Break
>arguments across lines like in the example below.
>
><cfscript>
>     // call method local to file for validating email address
>     var isValidEmail = checkEmail(arg1="[EMAIL PROTECTED]",
>                                                  arg2="secondArg",
>                                                  arg3="more than 2 args");
></cfscript>
>
>Again, like Mike, this is a choice for developers or development
>teams.  Both ways will work correctly.
>It's just an alternative, but the code ends up being more consistent
>because code that does the same thing (function calls) all looks the
>same.
>
>Just my two cents,
>
>t
>
>On 8/23/05, Michael Dinowitz <[EMAIL PROTECTED]> wrote:
>>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216077
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