JavaScript:SpiderMonkey:C Coding Style: Difference between revisions

Line 23: Line 23:
* 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.
** 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.
** Other binary operators go 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