Yes, you are allowed to use both options. I think this is a matter of preference. You can even mix.
Try this and see, mock some test function:
<cffunction name="testFunction" returntype="void" hint="I just spit out the arguments I get"> <cfdump var="#arguments#" label="arguments"> </cffunction> <cfset testFunction(arg1:"hello",arg2:"world") /> <cfset testFunction(arg1="hello",arg2="world") /> <cfset testFunction(arg1:"I can mix",arg2="my named argument syntax") />
Personally, I prefer = for named arguments. You may also notice that if you use IntelliJ IDEA to develop ColdFusion, then they do not recognize the colon syntax, so for better analysis you would like to use the = syntax. I can not speak for other IDEs
mlnyc
source share