coding_style
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
coding_style [2016/03/11 12:13] – [Naming] jmgr | coding_style [2016/03/11 12:17] – [Naming] jmgr | ||
---|---|---|---|
Line 33: | Line 33: | ||
| template parameter | SomeExample | | | | template parameter | SomeExample | | | ||
- | Never use abbreviations in names, having long names is not an issue: all IDEs have an auto-completion feature. | + | **Never use abbreviations in names, having long names is not an issue: all IDEs have an auto-completion feature.** |
<code cpp> | <code cpp> | ||
// Bad | // Bad | ||
Line 46: | Line 46: | ||
{ | { | ||
int averageFunctionSizePerAllocation = 42; | int averageFunctionSizePerAllocation = 42; | ||
+ | //... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Prefer using meaningful names instead of "one letter" | ||
+ | <code cpp> | ||
+ | // Bad | ||
+ | for(int i = 0; i < ducks.size(); | ||
+ | { | ||
+ | //... | ||
+ | } | ||
+ | |||
+ | // Good | ||
+ | for(int duckIndex = 0; duckIndex < ducks.size(); | ||
+ | { | ||
//... | //... | ||
} | } |
coding_style.txt · Last modified: 2023/04/25 16:52 by 127.0.0.1