-
Notifications
You must be signed in to change notification settings - Fork 47
Coding style
ptroja edited this page Dec 1, 2010
·
16 revisions
- authors of the files have to be listed in the top header comment in the Doxygen tag format
- C++ code formatting have to follow Eclipse CDT
.xml
code style file located in the top folder -
#define
should not be used for constants or computational macros; they are allowed for metaprogramming-like jobs - functions and variables floating in the global namespace should not be used
- functions and variables should be scoped inside a class, which make use of them
-
printf
/cout
debug data about correct program execution
- dynamic memory allocation is allowed only at system initialization; after that it breaks a real-time characteristics
- use of C-style arrays of numeric data;
[[Eigen::Matrix|http://eigen.tuxfamily.org/dox/TutorialCore.html#TutorialCoreMatrixTypes]]
is recommended - iterating collections with
for
loops;[[BOOST_FOREACH|http://www.boost.org/doc/libs/release/doc/html/foreach.html]]
is recommended - use of POSIX threads;
[[Boost:Thread|http://www.boost.org/doc/libs/release/doc/html/thread.html]]
is recommended - use of pointers where reference can be used
- use of reference without
const
qualifiers