JavaScript:SpiderMonkey:C Coding Style: Difference between revisions

Line 22: Line 22:
* Do not add tabs to source files (expand them at 8-space stops if they creep back in).
* Do not add tabs to source files (expand them at 8-space stops if they creep back in).
* Observe the 80-column limit per line, and break down lines that are too long.
* Observe the 80-column limit per line, and break down lines that are too long.
** Overlong conditions break after each && or || operator.
** Operators generally can go at the end, but often binary operators read better if the operator goes at the front of the second line.
* Four spaces of indentation per statement nesting level.
* Four spaces of indentation per statement nesting level.
* "case L:" labels in "switch" statements count as half of a nesting level, so indent two spaces, with the labeled statements indenting two more for a standard four spaces indentation from "switch" to a case-controlled statement.
* "case L:" labels in "switch" statements count as half of a nesting level, so indent two spaces, with the labeled statements indenting two more for a standard four spaces indentation from "switch" to a case-controlled statement.
Confirmed users, Bureaucrats and Sysops emeriti
419

edits