From 9ea35748100d9feb67a66f8a6656cc60f41bfa8c Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Wed, 18 Nov 2009 17:44:17 +0000 Subject: [PATCH] Move style guide stuff into separate file SVN-Revision: 6031 --- CODINGSTYLE | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ TODO | 35 ++++++++++++++--------------------- 2 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 CODINGSTYLE diff --git a/CODINGSTYLE b/CODINGSTYLE new file mode 100644 index 000000000..11a7e9938 --- /dev/null +++ b/CODINGSTYLE @@ -0,0 +1,51 @@ +SuperTux Coding Standards +========================= + +* proper separation between generic engine code and game specific code + should be done whenever feasible + +* the path in #include directives must not contain "..", all paths + must be relative to the src/ directory + +* external libraries are not allowed in src/, they go to external/ + +* do not use raw pointer and new/delete, use auto_ptr<> instead + +* properly separate data members and member functions, don't mix them + in the same public/private/protected section + +* conditional includes should be indended: + +#ifdef FOOBAR +# include "foobar.hpp" +#endif + +* include guards are of the form: + +#ifndef HEADER_SUPERTUX_{PATH}_{FILE}_HPP +#define HEADER_SUPERTUX_{PATH}_{FILE}_HPP + +* use one file per class + +* write namespaces like: "namespace NameSpace {", no newline before the '{', finish them with: + "} // namespace Namespace" + +* compile with the maximum warning level and with -Werror: + + -Werror -ansi -pedantic -Wall -Wextra -Wnon-virtual-dtor -Weffc++ + -Wcast-qual -Winit-self -Wno-unused-parameter + + possible additional flags for the future: -Wconversion -Wshadow + +* write doxygen comments as: + + /** This is a comment */ + + do not use /**< and other styles of comments + +* more info on good practices can be found at: + + http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml + + +# EOF # diff --git a/TODO b/TODO index ff546a032..b8c522bb7 100644 --- a/TODO +++ b/TODO @@ -4,13 +4,6 @@ solutions for them. Coding Standard =============== -* no external libraries in src/, they go to external/ - -* proper separation between engine and game specific code (especially - sound and video handling) - -* normalize #include directives (all refer to top level dir) - * use SCons instead of CMake * make code clean: "-O2", "-g3", @@ -29,21 +22,9 @@ Coding Standard * do not use raw pointer, especially not for Sprite and Surface -* properly separate data members and member functions, don't mix them - in the same section - -* write namespaces like: "namespace NameSpace {", no newline before the { - * only do one variable initialization per line, not multiple as its currently often done in initialization list -* conditional includes should be indended (makes it easier to handle - in include optimization): - -#ifdef FOOBAR -# include "foobar.hpp" -#endif - * remove overuse of multi-inheritance * remove overuse of friend'ship @@ -63,8 +44,6 @@ TODO * check the code with Valgrind -* cleanup doxygen comments, use /** */, nothing else - * static vs anonymous namespace * use Vector in Physics for 'a' and 'v' @@ -105,5 +84,19 @@ TODO * move bugtracker to http://code.google.com (much simpler, less useless) +* convert worldmap from const lisp::Lisp* lisp to "const Reader&" + +* having dictionary_manager in Lisp is extremely ugly + +* enforce proper naming of files to match their class + +* get rid of DEBUG and conditional compilation, these should be + reserved for a few tiny cases, not spread all over the code + +* split particlesystem_interactive + +* centralize menus + +* make a proper class out of supertux/resources.hpp # EOF # -- 2.11.0