User:Clonkonaut/Style Guidelines

Revision as of 21:24, 8 October 2009 by Clonkonaut (talk | contribs) (Created page with '== Scripting policy == Style guideline for coding C4Script in OpenClonk. The development is based on exchange of scripts. Therefore it is necessary to define some styling rules,...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Scripting policy

Style guideline for coding C4Script in OpenClonk. The development is based on exchange of scripts. Therefore it is necessary to define some styling rules, so that other developer can read your code more easily.

Indentation

Indent your code with tabs (ASCII 9). Use space (ASCII 32) for all other formatting.

Example:

public func foo() { bar(); if (1) { bar2(); } }

Braces

According to the poll in the forum: Braces are on their own line, on the same level of indentation as the structure they belong to. You may add braces around single statements in if statements if the first block or an else block has them.