[trivial][doc] Mention ++i as preferred to i++ in dev notes
This commit is contained in:
parent
12892dbb9f
commit
ab53207b9c
1 changed files with 4 additions and 3 deletions
|
@ -14,6 +14,7 @@ gradually.
|
||||||
- No indentation for public/protected/private or for namespaces.
|
- No indentation for public/protected/private or for namespaces.
|
||||||
- No extra spaces inside parenthesis; don't do ( this )
|
- No extra spaces inside parenthesis; don't do ( this )
|
||||||
- No space after function names; one space after if, for and while.
|
- No space after function names; one space after if, for and while.
|
||||||
|
- `++i` is preferred over `i++`.
|
||||||
|
|
||||||
Block style example:
|
Block style example:
|
||||||
```c++
|
```c++
|
||||||
|
@ -24,7 +25,7 @@ class Class
|
||||||
bool Function(char* psz, int n)
|
bool Function(char* psz, int n)
|
||||||
{
|
{
|
||||||
// Comment summarising what this section of code does
|
// Comment summarising what this section of code does
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; ++i) {
|
||||||
// When something fails, return early
|
// When something fails, return early
|
||||||
if (!Something())
|
if (!Something())
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue