Changeset View
Changeset View
Standalone View
Standalone View
doc/developer-notes.md
Show All 11 Lines | - Basic rules specified in [src/.clang-format](/src/.clang-format). | ||||
- Braces on new lines for namespaces, classes, functions, methods. | - Braces on new lines for namespaces, classes, functions, methods. | ||||
- Braces on the same line for everything else. | - Braces on the same line for everything else. | ||||
- 4 space indentation (no tabs) for every block except namespaces. | - 4 space indentation (no tabs) for every block except namespaces. | ||||
- No indentation for `public`/`protected`/`private` or for `namespace`. | - No indentation for `public`/`protected`/`private` or for `namespace`. | ||||
- 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`. | ||||
- Always add braces for block statements (e.g. `if`, `for`, `while`). | - Always add braces for block statements (e.g. `if`, `for`, `while`). | ||||
- `++i` is preferred over `i++`. | - `++i` is preferred over `i++`. | ||||
- `static_assert` is preferred over `assert` where possible. | |||||
Generally; compile-time checking is preferred over run-time checking. | |||||
- Use CamelCase for functions/methods, and lowerCamelCase for variables. | - Use CamelCase for functions/methods, and lowerCamelCase for variables. | ||||
- GLOBAL_CONSTANTS should use UPPER_SNAKE_CASE. | - GLOBAL_CONSTANTS should use UPPER_SNAKE_CASE. | ||||
- namespaces should use lower_snake_case. | - namespaces should use lower_snake_case. | ||||
- Function names should generally start with an English command-form verb | - Function names should generally start with an English command-form verb | ||||
(e.g. `ValidateTransaction`, `AddTransactionToMempool`, `ConnectBlock`) | (e.g. `ValidateTransaction`, `AddTransactionToMempool`, `ConnectBlock`) | ||||
- Variable names should generally be nouns or past/future tense verbs. | - Variable names should generally be nouns or past/future tense verbs. | ||||
(e.g. `canDoThing`, `signatureOperations`, `didThing`) | (e.g. `canDoThing`, `signatureOperations`, `didThing`) | ||||
- Avoid using globals, remove existing globals whenever possible. | - Avoid using globals, remove existing globals whenever possible. | ||||
▲ Show 20 Lines • Show All 554 Lines • Show Last 20 Lines |