]> Git Repo - VerusCoin.git/blame - coding.txt
Merge branch 'upnpfix' of https://github.com/TheBlueMatt/bitcoin
[VerusCoin.git] / coding.txt
CommitLineData
776d0f34 1Please be consistent with the existing coding style.\r
2\r
3Block style:\r
4\r
5bool Function(char* psz, int n)\r
6{\r
7 // Comment summarising what this section of code does\r
8 for (int i = 0; i < n; i++)\r
9 {\r
10 // When something fails, return early\r
11 if (!Something())\r
12 return false;\r
13 ...\r
14 }\r
15\r
16 // Success return is usually at the end\r
17 return true;\r
18}\r
19\r
20- ANSI/Allman block style\r
21- 4 space indenting, no tabs\r
22- No extra spaces inside parenthesis; please don't do ( this )\r
23- No space after function names, one space after if, for and while\r
24\r
25Variable names begin with the type in lowercase, like nSomeVariable.\r
26Please don't put the first word of the variable name in lowercase like\r
27someVariable.\r
28\r
29Common types:\r
30n integer number: short, unsigned short, int, unsigned int,\r
31 int64, uint64, sometimes char if used as a number\r
32d double, float\r
33f flag\r
34hash uint256\r
35p pointer or array, one p for each level of indirection\r
36psz pointer to null terminated string\r
37str string object\r
38v vector or similar list objects\r
39map map or multimap\r
40set set or multiset\r
41bn CBigNum\r
This page took 0.024084 seconds and 4 git commands to generate.