Dragora GNU/Linux-Libre

Artifact e30a2657946317ef44df47a1e7e1733ead9a47bc:

Wiki page [Style] by selk 2016-04-08 14:19:01.
D 2016-04-08T14:19:01.038
L Style
N text/x-markdown
P 64093b5b2afe4b7bce22240bc776a9c6b797ee8c
U selk
W 1531
# Style guidelines

Dragora source code should following the style guidelines below.

**General points:**

  *  No line of code exceeds 80 characters in length. (Occasional exceptions are  made for HTML text on @-lines.)

  *  No trailing white spaces.

  *  There are no tab characters.

  *  Line terminators are \\n only.  Do not use a \\r\\n line terminator.

  *  2-space or 4-space indentation is used, but no tabs.

Comments contain no spelling or grammatical errors. (Abbreviations and sentence fragments are acceptable when trying to fit a comment on a single line as long as the meaning is clear.)

The tone of comments is professional and courteous.  Comments contain no profanity, obscenity, or innuendo.

All comments and identifiers are in English.

**Functions:**

Unless the function is obvious enough use a brief header comment describing its use and implementation.

The name of a function clearly reflects its purpose.

**Variables:**

  *  The names of variables clearly reflect their use. 

  *  Don't use cryptic abbreviations but also avoid very long names 

  *  Related variables have related names. (ex: `aSavepoint` and `nSavepoint`.)

  *  Variables have minimum practical scope.

When a variable that refers to the same value is used within multiple scopes, the same name is used in all cases.

When variables refer to different values, different names are used even when the names are in different scopes.

Finally, when in doubt look at code already written.
Z ef578a33de84282ad566074dfea0da35