Skip to content

Commit 9c7d183

Browse files
stinosdpgeorge
authored andcommitted
CODECONVENTIONS.md: Add function/variable/argument naming convention
1 parent d02f671 commit 9c7d183

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

CODECONVENTIONS.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Header files:
3636
- Header files should be protected from multiple inclusion with #if
3737
directives. See an existing header for naming convention.
3838

39+
Function, variable and argument names:
40+
- Use underscore_case, not camelCase for all names.
41+
3942
Type names and declarations:
4043
- When defining a type, put '_t' after it.
4144

@@ -53,16 +56,16 @@ general guidelines are:
5356
Examples
5457
--------
5558

56-
Braces and spaces:
59+
Braces, spaces and names:
5760

58-
int foo(int x, int y) {
59-
if (x < y) {
60-
foo(y, x);
61+
int foo_function(int x, int some_value) {
62+
if (x < some_value) {
63+
foo(some_value, x);
6164
} else {
62-
foo(x + 1, y - 1);
65+
foo(x + 1, some_value - 1);
6366
}
6467

65-
for (int i = 0; i < x; i++) {
68+
for (int my_counter = 0; my_counter < x; my_counter++) {
6669
}
6770
}
6871

0 commit comments

Comments
 (0)