I have a question about cfargument
. If I am sending a parameter when calling a .cfc
, is there any benefit to defining it as argument first?
<cffunction name="someFunction" ....>
<cfargument name="myArg" required="no">
Or can I just use IsDefined() inside the function, without defining an argument?
<cffunction name="someFunction" ....>
...
<cfif isDefined("arguments.myArg")>
do something
</cfif>
I tried them and know that they both work. However, what is a difference between defining the argument and using isDefined()? Can that affect efficiency?