summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-19 13:11:32 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-19 13:11:32 +0000
commit6659d0bb14270d65f8ad85105ed2911677ab673c (patch)
tree2112507cfd5bd291e4971a6fdd5c2eebe53963e8 /docs
parentd42e9ea834a07c6f60dd5248db6520d1ff423ac4 (diff)
downloadmana-client-6659d0bb14270d65f8ad85105ed2911677ab673c.tar.gz
mana-client-6659d0bb14270d65f8ad85105ed2911677ab673c.tar.bz2
mana-client-6659d0bb14270d65f8ad85105ed2911677ab673c.tar.xz
mana-client-6659d0bb14270d65f8ad85105ed2911677ab673c.zip
Updates to hacking guide were in order.
Diffstat (limited to 'docs')
-rw-r--r--docs/HACKING.txt35
1 files changed, 22 insertions, 13 deletions
diff --git a/docs/HACKING.txt b/docs/HACKING.txt
index 614d2b13..fe89ead3 100644
--- a/docs/HACKING.txt
+++ b/docs/HACKING.txt
@@ -12,7 +12,7 @@ necessary.
* Line length:
Should not exceed 79 characters.
-
+
One reason for this is to keep code readable. In such cases it would often be
better to spread the line over multiple lines or use some extra temporary
variables. Another reason is that some of us are using editors that default
@@ -23,15 +23,20 @@ necessary.
* Control constructs like this:
Good:
- if (condition) {
+
+ if (condition)
+ {
}
- else {
+ else
+ {
}
- for (init; condition; step) {
+ for (init; condition; step)
+ {
}
- while (condition) {
+ while (condition)
+ {
}
/**
@@ -41,18 +46,22 @@ necessary.
* @param param1 the first argument
* @param param2 the second argument
*/
- void function(param1, param2) {
+ void function(param1, param2)
+ {
}
- class TheClass : public TheSupclass {
+ class TheClass : public TheSubclass
+ {
};
- Ending parenthesis may be on next line for clarity.
-
- Bad:
+ For if, for and while constructs, opening parenthesis may be placed on the
+ same line to save space.
+
+ In most cases these are bad:
+
if (condition)
statement;
-
+
if (condition) statement;
* Comments:
@@ -102,5 +111,5 @@ necessary.
To denote global variables and functions the lowercase_underscores style may
be used. Hungarian style should be avoided.
-* Whenever you add a new source file somewhere in ./src do not forget to add them
- in ./src/Makefile.am as well!
+* Whenever you add a new source file somewhere in ./src do not forget to add
+ them in ./src/Makefile.am as well!