aboutsummaryrefslogtreecommitdiff
path: root/docs/CODE_STYLE.md
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-03-14 10:36:51 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-03-14 10:36:51 +0100
commitc5c7a3e40fc3f78abacb26717fff4a260b47db8c (patch)
treed67b68040b09f40c277bd891161552243793b532 /docs/CODE_STYLE.md
parent519835c4b0c081ad388cfa6cf2e57bf9a8ac8676 (diff)
CODE_STYLE: mention braces for functions too
Diffstat (limited to 'docs/CODE_STYLE.md')
-rw-r--r--docs/CODE_STYLE.md12
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/CODE_STYLE.md b/docs/CODE_STYLE.md
index bcf13b46d..e06b0b8ea 100644
--- a/docs/CODE_STYLE.md
+++ b/docs/CODE_STYLE.md
@@ -56,7 +56,7 @@ resolution screens:
code windows next to each other on the same screen - as well as multiple
terminal and debugging windows.
-## Open brace on the same line
+## Braces
In if/while/do/for expressions, we write the open brace on the same line as
the keyword and we then set the closing brace on the same indentation level as
@@ -66,6 +66,14 @@ the initial keyword. Like this:
/* clearly a youngster */
}
+When we write functions however, the opening brace should be in the first
+column of the first line:
+
+ int main(int argc, char **argv)
+ {
+ return 1;
+ }
+
## 'else' on the following line
When adding an `else` clause to a conditional expression using braces, we add
@@ -75,7 +83,7 @@ it on a new line after the closing brace. Like this:
/* clearly a youngster */
}
else {
- /* probably intelligent */
+ /* probably grumpy */
}
## No space before parentheses