Small TODO, CODINGSTYLE update
[supertux.git] / CODINGSTYLE
1 SuperTux Coding Standards
2 =========================
3
4 * proper separation between generic engine code and game specific code
5   should be done whenever feasible
6
7 * the path in #include directives must not contain "..", all paths
8   must be relative to the src/ directory
9
10 * external libraries are not allowed in src/, they go to external/
11
12 * do not use raw pointer and new/delete, use auto_ptr<> instead
13
14 * properly separate data members and member functions, don't mix them
15   in the same public/private/protected section
16
17 * conditional includes should be indended:
18
19 #ifdef FOOBAR
20 #  include "foobar.hpp"
21 #endif
22
23 * use #include <> for libraries in external/
24
25 * include guards are of the form:
26
27 #ifndef HEADER_SUPERTUX_{PATH}_{FILE}_HPP
28 #define HEADER_SUPERTUX_{PATH}_{FILE}_HPP
29
30 * use one file per class
31
32 * write namespaces like: "namespace NameSpace {", no newline before the '{', finish them with:
33   "} // namespace Namespace"
34
35 * compile with the maximum warning level and with -Werror:
36
37   -Werror -ansi -pedantic -Wall -Wextra -Wnon-virtual-dtor -Weffc++
38   -Wcast-qual -Winit-self -Wno-unused-parameter
39
40   possible additional flags for the future: -Wconversion -Wshadow
41
42 * write doxygen comments as:
43
44   /** This is a comment */
45
46   do not use /**< and other styles of comments
47
48 * more info on good practices can be found at:
49
50   http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
51
52
53 # EOF #