Skip to content

Commit 781136d

Browse files
committed
docs: coding standards: refine style section
Describe the exceptions to K&R more fully. I recently had the privilege of setting up Eclipse's automatic formatter, so fill this out while it is still on my mind.
1 parent 1c1e21f commit 781136d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

DOCS/coding standards.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,28 @@ Another good read for api design is the Little Manual of API Design.
2020

2121
**In general this means:**
2222

23-
Indenting in QtCreator should left on the default Qt preset. Spaces not
24-
tabs. Try to code within 78 columns but don't be afraid to overflow for
25-
readability.
23+
Indenting in QtCreator should left on the default Qt preset. This is K&R
24+
with a few exceptions. Spaces not tabs. Try to code within 78 columns but
25+
don't be afraid to overflow for readability.
2626

27-
Data members exposed with getter/setters should internally end with _. Data
28-
members that are not exposed should not be mangled.
27+
Data members exposed with getter/setters should internally end with _ when
28+
they share the same name as a getter. Data members that are not exposed via
29+
getters and setters should not be mangled.
2930

3031
Don't close the parenthesis for a function call on a seperate line if you are
31-
splitting its parameters over more than one line. Make your calls pythonic.
32+
splitting its parameters over more than one line.
3233

3334
Opening braces inside a function are on the same line. There is no need to
3435
use a brace inside an if statement if there's only one statment there; adding
3536
it would introduce unnecessary visual noise.
3637

38+
Opening braces of a function are on a new line, since they introduce code.
39+
Opening braces of lambdas are on the same line.
40+
3741
Use two spaces after a period in comments.
3842

43+
Simple enums can be placed on the same line.
44+
3945
## Writing a module
4046

4147
Avoid macros, use C++11 (or better) features instead.

0 commit comments

Comments
 (0)