aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdoc/CODING-GUIDELINES27
1 files changed, 21 insertions, 6 deletions
diff --git a/doc/CODING-GUIDELINES b/doc/CODING-GUIDELINES
index 04b5b38d9..fc66c64e9 100755
--- a/doc/CODING-GUIDELINES
+++ b/doc/CODING-GUIDELINES
@@ -49,10 +49,25 @@ if (foo) {
Case statements:
switch (foo) {
- case BAR:
- blah();
- break;
- case OTHER:
- other();
- break;
+case BAR:
+ blah();
+ break;
+case OTHER:
+ other();
+ break;
+}
+
+No nested statements without braces, e.g. no:
+
+for (x=0;x<5;x++)
+ if (foo)
+ if (bar)
+ baz();
+
+instead do:
+for (x=0;x<5;x++) {
+ if (foo) {
+ if (bar)
+ baz();
+ }
}