I know the result is the same but is there any real difference? Maybe speed or something?
component {
 remote function getMath(){ 
    math = 2 + 2;   
    return math;
  }
}
or
<cfcomponent>
  <cfscript>
    remote function getMath(){  
        math = 2 + 2;   
        return math;
    }
  </cfscript>   
</cfcomponent>
or
<cfcomponent>
  <cffunction name="getMath" access="remote">
      <cfscript>
            math = 2 + 2;   
            return math;
      </cfscript>   
  </cffunction>             
</cfcomponent>
Not especially.
Version 3, full tags, will be backwards compatible with ColdFusion 8 and the open source versions of ColdFusion server eg. Railo or OpenBD.
Version 2 is neither something or nothing.
Version 1 is the full ColdFusion 9 script version.
I would recommend that you choose between the first and last versions and stick to it. Version 2 is not backwards compatible to coldfusion 8 and is neither tag nor script. Coding like this will get messy quickly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With