comparison mcabber/CodingStyle.txt @ 1509:189ffdd944b4

Add a small Coding Style document
author Mikael Berthe <mikael@lilotux.net>
date Sun, 31 Aug 2008 15:21:49 +0200
parents
children ffd0e57e9563
comparison
equal deleted inserted replaced
1508:86620c83123b 1509:189ffdd944b4
1 This document describes the preferred coding style for the mcabber project.
2
3 If you intend to patch and contribute to mcabber, please try to use the
4 existing style, and read the following points.
5
6 - Do not use tabs, use space characters;
7 - Avoid trailing whitespace;
8 - Avoid lines longer than 80 characters;
9 - Indentation is 2 spaces (ok, maybe it isn't a good idea but it's the
10 current style);
11 - Put a space after non-functions statements (e.g. if, while...)
12 - Put the opening brace last on the same line, and put the closing brace first
13 except for functions, where the opening brace should be alone on a new line.
14
15 Example:
16
17 void example(void)
18 {
19 if (cond1) {
20 do_a();
21 } else if (cond2) {
22 do_b();
23 } else {
24 do_c();
25 }
26
27 if (error)
28 exit(0);
29 }
30
31 - Look at existing code for rules not mentioned here.
32
33 Mikael