Edgewall Software

Changes between Version 16 and Version 17 of TracDev/CodingStyle


Ignore:
Timestamp:
Aug 5, 2011, 7:18:58 PM (13 years ago)
Author:
Peter Suter
Comment:

Collecting some JavaScript advice

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/CodingStyle

    v16 v17  
    4747   macros, respectively.
    4848
     49== JavaScript ==
     50!JavaScript code should follow [http://javascript.crockford.com/code.html these conventions] with the following exceptions and additions:
     51* Lines shouldn't exceed a length of 79 characters.
     52* Use two spaces for indentation.
     53* Use `lowercase` for variable names.
     54* Use `camelCase` for functions.
     55* Define non-anonymous functions as `function fooBar() {...}` (rather than `var fooBar = function() {...}`)
     56* Keep as much as possible private, by defining private functions in an inner scope. Attach functions you want to export to the $ symbol.
     57* Use a "trac-" prefix for all id and class names. (For new names. Changing old names would break customizations.)
     58
    4959----
    5060See also: TracDev