-
Notifications
You must be signed in to change notification settings - Fork 1
/
CodeStyle
72 lines (55 loc) · 864 Bytes
/
CodeStyle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
All project is written on English!!
//First letter on methods all in kamelcase
void thisIsAFunction();
//Brackets on function
void foo()
{
//Funct
}
//Brackets on if (ALLWAYS)
if()
{
//code
}
else
{
//code
}
//Identation
TAB de 4 espacios
//switchcase
switch ()
{
case X:
//code
break;
default:
//code
break;
}
//Magic numbers
forbiden use of numbers inside the conditions (use defines!)
//Class sample (functions on cpp are order like their position on the header)
class A
{
public:
void foo();
public:
int a;
private:
void fuu();
private:
int b;
}
//Between two functions endline;
void foo() {}
void fuu() {}
//Variable definition
int a, b, c;
bool res;
//If the condition is a bool don't use == true/false
if (boolCondition)
{
}
//Use aserts if the function recieve a pointer.
//Have fun!