Mail Archives: djgpp-workers/1997/10/30/07:46:40
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 -