Skip to content
Adam Chapman edited this page Aug 25, 2016 · 37 revisions

Current rules:

  • Avoid lines longer than 120 characters when possible.
  • Put opening curly brace on same line as function, e.g: public void function x() {
  • local scope replaces loc

New suggestions for discussion:

  • No indentation needed after <cfscript> tag.
  • Blank line before comment when it's not at the start of a block.
  • Default arguments should have spaces, e.g.: string action = ""
  • Functions with more than 2 arguments should be on separate lines

Proposed Code Example

component {

  public struct function(
    required string foo,
    required string bar,  
    numeric number = 1
  ) {
    local.rv = Duplicate(arguments)
    return local.rv;
  }

}

Clone this wiki locally