diff options
| author | stijn <stijn@ignitron.net> | 2015-06-24 11:52:51 +0200 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2015-06-24 17:35:27 +0100 |
| commit | 9c7d183a94af60177dea14c1bfd2754dbfdda933 (patch) | |
| tree | 686558575948daf82b08c033f36b873da69c2cb5 | |
| parent | d02f671737ebfe90026790de98b6b08752680354 (diff) | |
CODECONVENTIONS.md: Add function/variable/argument naming convention
| -rw-r--r-- | CODECONVENTIONS.md | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/CODECONVENTIONS.md b/CODECONVENTIONS.md index bcbea2ca0..e9050a2d8 100644 --- a/CODECONVENTIONS.md +++ b/CODECONVENTIONS.md @@ -36,6 +36,9 @@ Header files: - Header files should be protected from multiple inclusion with #if directives. See an existing header for naming convention. +Function, variable and argument names: +- Use underscore_case, not camelCase for all names. + Type names and declarations: - When defining a type, put '_t' after it. @@ -53,16 +56,16 @@ general guidelines are: Examples -------- -Braces and spaces: +Braces, spaces and names: - int foo(int x, int y) { - if (x < y) { - foo(y, x); + int foo_function(int x, int some_value) { + if (x < some_value) { + foo(some_value, x); } else { - foo(x + 1, y - 1); + foo(x + 1, some_value - 1); } - for (int i = 0; i < x; i++) { + for (int my_counter = 0; my_counter < x; my_counter++) { } } |
