coding_style
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
coding_style [2016/03/11 12:17] – [Naming] jmgr | coding_style [2023/04/25 16:52] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 53: | Line 53: | ||
<code cpp> | <code cpp> | ||
// Bad | // Bad | ||
- | for(int i = 0; i < Ducks.size(); ++i) | + | for(int i = 0; i < ducks.size(); ++i) |
{ | { | ||
//... | //... | ||
Line 59: | Line 59: | ||
// Good | // Good | ||
- | for(int duckIndex = 0; duckIndex < Ducks.size(); ++duckIndex) | + | for(int duckIndex = 0; duckIndex < ducks.size(); ++duckIndex) |
{ | { | ||
//... | //... | ||
} | } | ||
+ | </ | ||
+ | |||
+ | **Variables representing GUI elements should be suffixed by their type** | ||
+ | <code cpp> | ||
+ | // Bad | ||
+ | QPushButton *exitApplication; | ||
+ | QLabel *duckCount; | ||
+ | |||
+ | // Good | ||
+ | QPushButton *exitApplicationPushButton; | ||
+ | QLabel *duckCountLabel; | ||
</ | </ | ||
===== Code files ===== | ===== Code files ===== | ||
Line 68: | Line 79: | ||
==== Code separation ==== | ==== Code separation ==== | ||
- | Generally speaking, each class/ | + | Generally speaking, each class/ |
==== Naming ==== | ==== Naming ==== | ||
coding_style.1457698623.txt.gz · Last modified: 2023/04/25 16:52 (external edit)