-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.txt
52 lines (45 loc) · 1.48 KB
/
style.txt
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
Format:
Indents:
Two space indent
case is indented by only one space
the code inside is indented two spaces from the switch statement
stuff inside DEBUGR is indented if more than one line
Spaces:
if( not if (
for(i=0;i<5;i++){
){ not ) {
function arguments are f(x, y) or f(x,y) not f( x, y )
equals signs may have either 0 or 1 space on both sides
the two sides must be the same
pointer casts are (char*)x
pointer type is int *px;
no empty lines at beginning or end of blocks
Comments:
commented code has no space after the //
normal comments have a space after the //
normal multiline comments are like
/*
* Name: RbCaVi
* Date: today
*/
multiline commented code has no stars at the start of lines
Includes:
include "shared.h++"
then builtin headers
library headers
project headers
code files (c or c++)
Classes:
classes always have an access modifier (public or private) at the start
the access modifier has no empty lines before it if it's the first line in the class
otherwise it has one empty line before it
Code:
each set of code files (c++ and h++, and possibly a few more) has its own set of *_DEBUG symbols
they are (name of main file, all caps)_DEBUG or (name of main file, all caps)_(subsection)_DEBUG
all headers must have include guards
#ifndef (file name)_H
#define (file name)_H
(includes)
(code)
#endif
all public classes are defined in an h++ file