summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGarrett Berg <googberg@gmail.com>2015-06-12 20:49:01 -0600
committerDamien George <damien.p.george@gmail.com>2015-06-25 10:56:39 +0100
commitf64e080d9abe4e7b1c59d99fc7df2cfdcbb8320e (patch)
tree029181dd12d20f7c208d990372272ee3f8ccca19
parente44c1d3acef6d1a81e9496d1a4a8c4d12e2fd0a6 (diff)
downloadmicropython-f64e080d9abe4e7b1c59d99fc7df2cfdcbb8320e.tar.gz
micropython-f64e080d9abe4e7b1c59d99fc7df2cfdcbb8320e.zip
CODECONVENTIONS.md: add documentation on putting comments in code.
-rw-r--r--CODECONVENTIONS.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/CODECONVENTIONS.md b/CODECONVENTIONS.md
index 9d5f6d0cca..ac04379be5 100644
--- a/CODECONVENTIONS.md
+++ b/CODECONVENTIONS.md
@@ -52,13 +52,19 @@ general guidelines are:
- You can use int/uint, but remember that they may be 16-bits wide.
- If in doubt, use mp_int_t/mp_uint_t.
+Comments:
+- Be concise and only write comments for things that are not obvious.
+- Use `// ` prefix, NOT `/* ... */`. No extra fluff.
+
Examples
--------
-Braces, spaces and names:
+Braces, spaces, names and comments:
#define TO_ADD (123)
+ // This function will always recurse indefinitely and is only used to show
+ // coding style
int foo_function(int x, int some_value) {
if (x < some_value) {
foo(some_value, x);