-
Notifications
You must be signed in to change notification settings - Fork 44
Coding Standard reference
Joseph Pearson edited this page Jul 11, 2014
·
14 revisions
Every control should be named with the correct prefix, followed by the name of the parents control, then the name of this control, optionally followed by its correct suffix. (See the table bellow)
| Control | Prefix | Suffix |
|---|---|---|
| Button | BTN_ | - |
| CheckBox | CHK_ | - |
| TextBox | TXT_ | - |
| DataGridView | DGV_ | - |
| Label | LBL_ | - |
| TabControl | TAB_ | - |
| TabPage | TAB_ | _Page |
| ComboBox | CMB_ | - |
| GroupBox | GRP_ | - |
| ListBox | LST_ | - |
| PropertyGrid | PG_ | - |
| OpenFileDialog | OFD_ | - |
- Member variable should start with the prefix
m_and use camelCase (e.g. 'm_beaconPowerTest') - Member variables should be private or protected unless it is public static
Every public components of a class MUST be correctly commented
Code indentation should be done with tabs, NOT spaces. This is to prevent Git conflicts due to inconsistent whitespace characters or newlines. Most client-side merge utilities can handle this but the diff/merge tool built into Github cannot.
Classes should contain the following regions:
- Attributes - Fields of the class aka member variables
- Constructors and Initializers
- Properties - Property get+set methods
- Methods - Everything else