Difference between revisions of "Code Formatting Conventions"

Jump to navigation Jump to search
Updated the explanation for our formatting conventions
m (fine-tuning)
(Updated the explanation for our formatting conventions)
Line 1: Line 1:
== Use common sense ==
== Use common sense ==


These are conventions which we try to follow when writing code for ScummVM. They are this way mainly for reasons of taste, however, sticking to a common set of formatting rules also makes it slightly easier to read through our sources. If you want to submit patches, please try to follow these rules.  
These are conventions which we try to follow when writing code for ScummVM. Sticking to a common set of formatting / indention rules makes it easier to read through our source base (which now exceed half a million lines of code by far, making this quite important). If you want to submit patches, please try to adhere to these rules.


As such we don't follow these rules slavishly, in certain cases it is OK (and in fact favorable) to stray from them.
We don't always follow these rules slavishly, in certain cases it is OK (and in fact might be favorable) to stray from them. Applying common sense, as usual, is a good idea.


In the following examples tabs are replaced by spaces for visual consistency with the Code Formatting Conventions.
In the following examples tabs are replaced by spaces for visual consistency with the Code Formatting Conventions. But in actual code, use tabs for indentions (our tabs are assumed to be 4 spaces wide).


== Hugging braces ==
== Hugging braces ==
1,079

edits

Navigation menu