Skip to content

Commit f64e080

Browse files
vitiraldpgeorge
authored andcommitted
CODECONVENTIONS.md: add documentation on putting comments in code.
1 parent e44c1d3 commit f64e080

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

CODECONVENTIONS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,19 @@ general guidelines are:
5252
- You can use int/uint, but remember that they may be 16-bits wide.
5353
- If in doubt, use mp_int_t/mp_uint_t.
5454

55+
Comments:
56+
- Be concise and only write comments for things that are not obvious.
57+
- Use `// ` prefix, NOT `/* ... */`. No extra fluff.
58+
5559
Examples
5660
--------
5761

58-
Braces, spaces and names:
62+
Braces, spaces, names and comments:
5963

6064
#define TO_ADD (123)
6165

66+
// This function will always recurse indefinitely and is only used to show
67+
// coding style
6268
int foo_function(int x, int some_value) {
6369
if (x < some_value) {
6470
foo(some_value, x);

0 commit comments

Comments
 (0)