Mobilizer coding conventions
============================

$Id: README.codingstyle.txt,v 1.5 2001/03/23 04:12:15 pascal Exp $

- Use the 'debug()' macro to print write debugging information.

- Comments must always wrap at 72 columns. Code can extend beyond that
  if formatting it differently is impossible or makes maintaining it
  difficult.

- Never use C++ style comments, instead always use /* */.

- Start comments with a capital and end them with a period.

- Always put comments above a line or block of code; never to the 
  right of it.

- Don't use tabs. Use 2 spaces instead.

- Use a single space after all operators, names and semicolons (;),
  exception: preinc/decrement ( --i), postinc/decrement (i++ )
  exception: no added space when the following operator is 
  one of: -> & * []
  
- Put opening braces on the same line as their opening construct.

- Use NULL for pointer comparison; 0 for integer comparison

- Member variables must have long descriptive names. For variables
  local to the function or block, short names are preferred.

- #include system headers first, then shared library headers, then
  your own headers. That is, include in increasing order of specificity.
  
- Never #define a constant like 'error' or 'ok'; constants should always be
  in uppercase and preferably prefixed with some unique identifier to 
  prevent namespace collisions.
  
- Write enums like this:

    enum myEnum {
       firstId,
       secondId,
       thirdId
    };
    
- try ... catchy blocks like this:

    try {
      ...
    } catch(...) {
      ...
    } catch(...) {
      ...
    }
    
- if blocks like this:

    if(a) {
    
      ... large block of code ...
      
    }
    
  or like this:
  
    if(a)
      return;
    /* empty line */

  but never like this:
  
    if(a) return;

  if ... else blocks should look like this:
  
    if(a) {
    
      return;
      
    } else {
    
      ... large block of code ...
      
    }
    
  rather than this:
  
     if(a)
       return;
     else {
     
       ... large block of code ...
     
     }
     
- Function bodies start with an empty line:
  
  void func() {
  
    ... code ...
    
  }
  
  unless the body starts with a variable declaration:
  
  void func() {
    int i;
    
    ... code ...
    
  }
  
