From 3ab896dcbc80d1de49a625571ed0a63946fa0008 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 3 Mar 2016 18:37:47 +0100 Subject: Adding convention reference --- conventions.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 conventions.md diff --git a/conventions.md b/conventions.md new file mode 100644 index 0000000..875292f --- /dev/null +++ b/conventions.md @@ -0,0 +1,41 @@ +Coding conventions +================== + +This document contains some syntactic and code format conventions for the current project and should be used as a +reference to enhance code uniformity. + + +Formatting +---------- + +Sources are formatted as defined in the `EPFL-PPO.xml` Eclipse format file. + + +Members ordering +---------------- + +Class (static) members are placed before object members. In each group, attributes are placed before methods. +Constructors are the first methods, and overridden parent methods the last ones. + + +Object/Class reference +---------------------- + +Methods and attributes are referenced using `this` for the current class, and by their class name for static +ones. + +Static imports are avoided, except for JUnit tests. + + +Redundant type/scope +-------------------- + +Use of the diamond notation is encouraged to avoid redundancy. + +Unnecessary scope modifiers are avoided (ex: `public` in interfaces). + + +Unnecessary brackets +-------------------- + +Unnecessary brackets in one to two line statements are avoided to simplify the reading of the control flow. -- cgit v1.2.3