Coding Notes

This is simply a collection of notes about coding stuff to maintain consistency.

A good way to maintain consistency is have the editor do the indenting/commenting etc. If you use the right profile code then there are some emacs functions to do this which include:

Indenting

The standard for code has been to indent by two for each block, there seems no reason to change it. Line length should be kept to somewhere between 80 and 90 chars, i.e. something that will fit comfortably on to a screen with a reasonable font size.

int func(void)
{
  int some_var ;

  if (blah)
    {
      call_something() ;
    }

  return ;
}

Commenting Style

Block comments and line comments should be in this style:


  if (blah)
    {
      /* This is quite a long block
       * comment that runs to more than one
       * line. */
      call_something() ;				    /* unknown function */
    }

Ed Griffiths <edgrif@sanger.ac.uk>
Last modified: Fri Nov 7 09:30:36 GMT 2003