Personal tools
You are here: Home Random Bits Coding Style
Document Actions

Coding Style

by Howard The Duck last modified 2004-08-02 09:49 PM

All points listed below are meant to be suggestions. This is only a draft for discussion. In the end the Guidelines will never be "final" to adapt technological changes like better compilers, source control systems and to get rid of problems that may appear in workflows presented here.

Version 0.3

Source-Code:

General:

  • rules found here apply
  • Filename-Extensions are .cpp for code and .hpp for headers
  • indentation with TAB only or 4 spaces per indent. What to use is decided per project.
  • Brackets { and } always have their own line e.g.:
                  for (int i=0; i<5; i++)
                  {
                    x += i;
                    cout << x;
                  }
    
  • Brackets { and } don't have to be used for single commandlines e.g.:
                  for (int i=0; i<5; i++)
                      x += i;
    
  • avoid #define for constants and macros (except the #ifdef trick for header files)
  • no C style memory functions like malloc(), free() are allowed to be used
  • usage of the STL whenever possible
  • read the Book of Bjarne Stroustroup... 2 times or more ;)

Documentation:

  • LateX, Docbook and Structured Text only
  • Documentation-Tool Doxygen

    + leads to useful documentation of important functions and classes

    + widely used

    crazy XML, but can be transferred to Docbook

    ToDo: find or create a XSL sheet for Docbook generation

  • language english?
  • Date format is always DD.MMM.YYYY where MMM is the full or abbreviated monthname e.g.: 01.Jan.2002 or 18.August.2002 to avoid misinterpretation.

Environment:

  • Main Library: Qt 3.x

    + crossplatform Linux, Win and Mac

  • gcc 3.2 or higher

    + better c++ compliance (exceptions)

    + faster executables

  • Subversion - SVN

    + far superior to CVS

    + uses DAV a standard protocol

    + uses the apache webserver as server

    in Alpha stage

Releases:

  • primary target

    + Linux x86

  • source release-format

    + tar.bz2 (smaller than tar.gz)

    + anonymous SVN access

  • binary release-format

    + rpm, deb

« July 2008 »
Su Mo Tu We Th Fr Sa
12345
6789101112
13141516171819
20212223242526
2728293031
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: