delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/10/30/07:46:40

Sender: itm AT delorie DOT com
Message-ID: <34588079.3C79AA54@dera.gov.uk>
Date: Thu, 30 Oct 1997 12:41:29 +0000
From: Ian Miller <itmiller AT dera DOT gov DOT uk>
Organization: DERA
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
CC: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
Subject: Re: Style Sheet

Allow me to suggest the following as a style sheet. It's mainly a cut
down version of Vik Heyndrickx' original. (I don't like people telling
me how to program. IMHO a "style sheet" should stick to code layout.
No offence intended, by the way :)

- Indentation

    Use the style (apparently) favoured by DJ Delorie:

    if (expr) 
    {
      stat1;
    } 
    else 
    {
      stat2;
    }
    
    Not-nested function definitions and declarations start at the most
    left hand position.
    Preprocessor directive lines start at the most left hand position.
    There is no whitespace after the `#' of a preprocessor directive.
    Put #include <...> lines before #include "..." lines.

- Variable names:

    Avoid polluting the ANSI and POSIX namespaces.
    Example of bad practice?
  
- Compilation:

    Make sure your code compiles without warnings when you use the
    -Wall switch and everyone will love you.

- File names:

    Stick to 8+3 filenames. DJGPP has to compile on vanilla MS-DOS.

Regards, Ian
--
Ian Miller, Dorset, UK
--
The views expressed above are entirely those of the writer and
do not represent the views, policy, or understanding of any
other person or official body.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019