Browse Source

Add a few style notes to Contributing guide;

bjorn 5 years ago
parent
commit
30740bf0e0
1 changed files with 6 additions and 0 deletions
  1. 6 0
      guides/Contributing.md

+ 6 - 0
guides/Contributing.md

@@ -30,6 +30,12 @@ submitting.  Try to stick to the existing coding style:
 - 2 space indentation.
 - 2 space indentation.
 - 100 character wrapping (ish, sometimes it's more readable to just have a long line).
 - 100 character wrapping (ish, sometimes it's more readable to just have a long line).
 - Use descriptive, camelCased variable names when possible.
 - Use descriptive, camelCased variable names when possible.
+- Put stars near types: `Texture* texture`.
+- Use curly braces for the bodies of conditionals and loops, and place them on their own line.  An
+  exception can be made for very short blocks -- they can be placed inline without curlies, e.g.
+  `if (data == NULL) return;`.
+- Always use spaces around binary operators.
+- Always use spaces before the parentheses and curlies in control flow: `while (condition) {`.
 
 
 Organization
 Organization
 ---
 ---