Directory Structure =================================== The source tree, and only the source tree, will go into CVS. There will be a common directory for libraries that are used by both learning and robotics, and then subtrees for robotics and learning. Each of these should have a "core" subtree, which is basica functionality and has minimal pre-reqs. Any outside code go falls into the top level "external" branch, if it goes in at all. File Names/Sizes =================================== C++ source files end in .cpp, header files in .H. C files follow standard convention. Try to keep file sizes reasonable. Coding Conventions =================================== Declare copy constructors and senseless conventions as private. Global variables should be prepended with g_, statics with s_, and member variables with m_. All classes (for which it makes sense) should conform to the STL. Be sure to make your constructors explicit. Dynamic Memory Allocation =================================== Please avoid allocating memory dynamically whenever possible (which should be most of the time). It's just asking for segmentation faults. If you need a dynamic array, use the STL, unless you've got a really good reason. I *will* make you fix your code if I see dynamically allocated memory. When you *do* allocate memory, be sure to use the correct functions. If you're coming from a C background, do not use malloc/free: use new, new[], delete, delete[]. External Dependencies =================================== Keep them out of the source tree. If they have to be in the source tree, put them in the external branch, but that should be rare. When possible, use versions of libraries which are current in Debian. A library with a binary package is always preferable to one which I have to compile. Style Guidelines =================================== Braces always on the same line. camelCased variables and functions. Types should be CapitalizedLikeThis. Be consistent-- if code is written with underscores, instead of camel case, for example, use underscores. Indentation =================================== Use full tabs. Make sure your editor of choice is configured to do so. For emacs, add (defun my-c++-indent-setup () (setq c-basic-offset 7) (setq indent-tabs-mode t)) (add-hook 'c++-mode-hook 'my-c++-indent-setup) to your .emacs Commenting =================================== Use doxygen style comments before all functions and types. I usually use the javadoc short style for convenience. It looks like this: /** * This sentence is the short description. This sentence will be added to the full * description. So will this one, ad infinitum * * \todo There's some broken stuff here, that needs to be fixed. * \param x This is a parameter that we're not actually using. */ The doxygen manual can be found at http://www.stack.nl/~dimitri/doxygen/manual.html And many other places besides.