Skip to content
Daniel edited this page Oct 16, 2013 · 2 revisions

Coffeescript

Files

  • Use under_score filenames (i.e. awesome_filename.coffee)

Syntax

  • Use PascalCase for object/class names (i.e. AwesomeClass)
  • Use camelCase for variables of all kinds, including methods and functions (i.e. isAwesome)
  • Use UNDER_SCORE for constants (i.e. AWESOME_CONSTANT).
  • Assign constants as prototype attributes above the constructor (i.e. AWESOMENESS_LEVEL: 9001).
  • A method body is followed by two white lines. Between the declaration (parameter list) and body is one white line.
  • When commenting an entire method, place the comment under the method declaration (above the white line)
  • Use quotation marks (i.e "string") instead of apostrophes (i.e. 'string') for strings
  • Always invoke methods with parentheses (i.e. alert("I am awesome"))
Clone this wiki locally