Tuesday 2 December 2014

(CFML) A quick survey about how you write your function signatures

The subject kinda says it all. I'm just curious as to how people tend to code their function signatures, so I'm running a short survey.


The survey is closed: Survey Monkey will only allow me to gather 100 responses, which I've now got.

The main question is:

All things being equal, which of the following example function signatures would you tend to use most often?

(a) fully-qualified script syntax

public numeric function getValuesOverThreshold(required array data, numeric threshold=0){
    // implementation

(b) minimal script syntax

function getValuesOverThreshold(array, threshold=0){
    // implementation

(c) fully-qualified tag syntax

<cffunction name="getValuesOverThreshold" returntype="numeric" access="public" output="false">
    <cfargument name="data" type="array" required="true">
    <cfargument name="threshold" type="numeric" required="false" default="0">
    <!--- implementation --->

(d) minimal tag syntax

<cffunction name="getValuesOverThreshold">
    <cfargument name="data">
    <cfargument name="threshold">
    <!--- implementation --->

There's a coupla other framing questions, but that's the info I'm after. I'd be great if you could put your oar in.