diff options
author | Timothée Floure | 2016-03-03 22:02:39 +0100 |
---|---|---|
committer | Timothée Floure | 2016-03-03 22:02:39 +0100 |
commit | 249778111cc6ac1f8d16b1c7141a037008dc728f (patch) | |
tree | 7b9131461b0ab8f34452964c15979a3554e8e204 | |
parent | 264fec2ec938a6c525ca6f569692118a8216ca19 (diff) | |
parent | 3ab896dcbc80d1de49a625571ed0a63946fa0008 (diff) | |
download | xblast-249778111cc6ac1f8d16b1c7141a037008dc728f.tar.gz |
Merge branch 'conventions' into 'master'
Coding conventions
If agreed, merge into master.
See merge request !2
-rw-r--r-- | conventions.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/conventions.md b/conventions.md new file mode 100644 index 0000000..875292f --- /dev/null +++ b/conventions.md | |||
@@ -0,0 +1,41 @@ | |||
1 | Coding conventions | ||
2 | ================== | ||
3 | |||
4 | This document contains some syntactic and code format conventions for the current project and should be used as a | ||
5 | reference to enhance code uniformity. | ||
6 | |||
7 | |||
8 | Formatting | ||
9 | ---------- | ||
10 | |||
11 | Sources are formatted as defined in the `EPFL-PPO.xml` Eclipse format file. | ||
12 | |||
13 | |||
14 | Members ordering | ||
15 | ---------------- | ||
16 | |||
17 | Class (static) members are placed before object members. In each group, attributes are placed before methods. | ||
18 | Constructors are the first methods, and overridden parent methods the last ones. | ||
19 | |||
20 | |||
21 | Object/Class reference | ||
22 | ---------------------- | ||
23 | |||
24 | Methods and attributes are referenced using `this` for the current class, and by their class name for static | ||
25 | ones. | ||
26 | |||
27 | Static imports are avoided, except for JUnit tests. | ||
28 | |||
29 | |||
30 | Redundant type/scope | ||
31 | -------------------- | ||
32 | |||
33 | Use of the diamond notation is encouraged to avoid redundancy. | ||
34 | |||
35 | Unnecessary scope modifiers are avoided (ex: `public` in interfaces). | ||
36 | |||
37 | |||
38 | Unnecessary brackets | ||
39 | -------------------- | ||
40 | |||
41 | Unnecessary brackets in one to two line statements are avoided to simplify the reading of the control flow. | ||