summaryrefslogtreecommitdiff
path: root/docs/HACKING.txt
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 23:41:48 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 23:41:48 +0100
commit301fb81834a482e1b30c3b4fa5032ed80d8e7c0f (patch)
tree546f3d98c7b15e38d46cbe78605826dfcacfaa9c /docs/HACKING.txt
parente26de771954973f396e6f018fa885fe8c95673ed (diff)
downloadmana-301fb81834a482e1b30c3b4fa5032ed80d8e7c0f.tar.gz
mana-301fb81834a482e1b30c3b4fa5032ed80d8e7c0f.tar.bz2
mana-301fb81834a482e1b30c3b4fa5032ed80d8e7c0f.tar.xz
mana-301fb81834a482e1b30c3b4fa5032ed80d8e7c0f.zip
Updated hacking guide
Diffstat (limited to 'docs/HACKING.txt')
-rw-r--r--docs/HACKING.txt26
1 files changed, 23 insertions, 3 deletions
diff --git a/docs/HACKING.txt b/docs/HACKING.txt
index 8c9c4dcb..88d22e7e 100644
--- a/docs/HACKING.txt
+++ b/docs/HACKING.txt
@@ -2,6 +2,9 @@
The Mana World Hacking Guide
----------------------------
+This guide is also available at http://wiki.themanaworld.org/index.php/Hacking
+including more tips about C++ programming in general.
+
With multiple coders working on the same source files, there needs to be a
standard specifying how code is written down. Not doing so can cause quite some
annoyance for certain coders and easily creates more version conflicts than
@@ -54,16 +57,33 @@ necessary.
{
};
- For if, for and while constructs, opening parenthesis may be placed on the
- same line to save space.
+ When there is only one statement you may leave out the braces, but don't
+ place the statement on the same line as the condition:
- In most cases these are bad:
+ Good:
if (condition)
statement;
+ Bad:
+
if (condition) statement;
+* Includes:
+ Source files should include their header first, to make sure the headers are
+ self-contained. After that follow other project includes, grouped by
+ directory and alphabetically ordered. System includes come last. All project
+ includes are done relative from the 'src' directory.
+
+ Good (subdirectory/source.cpp):
+
+ #include "subdirectory/header.h"
+
+ #include "somesub/bar.h"
+ #include "somesub/zaro.h"
+
+ #include <systemlib.h>
+
* Comments:
Single line C++ style comments are indented the same as the previous line.