-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathCODING_STYLE
69 lines (50 loc) · 1.3 KB
/
CODING_STYLE
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
DirectFB Coding Style
---------------------
The purpose of this document is to give developers a brief description
of the preferred coding style for the DirectFB source code.
Indentation
-----------
Each new level of code is indented by using 5 spaces, no tabulations at all.
Tabulations have a different meaning for different editors and we want to
keep uniformity.
A line of code should not be longer than 120 columns.
Functions
---------
Refer to the following prototypes:
type
function( args )
{
do_something( args );
}
type
function( very_long_argument1,
very_long_argument2,
very_long_argument3 )
{
do_something( very_long_argument1,
very_long_argument2,
very_long_argument3 );
}
Braces
------
We use a bracing style similar to K&R style:
if (condition) {
do_this();
do_that();
}
else {
do_other();
}
if (condition_1 && condition_2 && condition_3 &&
condition_4 && condition_5 && condition_6)
{
do_this();
do_that();
}
else {
do_other();
}
Final Recommendations
---------------------
Do not take these hints as strict rules for coding, we rely on your
good taste.