A question on C programming style

Michael Johnston id8rld06 at serss0.fiu.edu
Tue Apr 16 10:06:06 AEST 1991


In responce to the question of whether to use nested includes:

I use nested includes. At the very top of each include is a comment
identifying the file. Following that is something like:

#ifndef MODULE_NAME
#define MODULE_NAME

#include ...

[the rest of the include file goes here]

#endif

This way, any include file necessary is right there. Now, anyone using
this module only needs to know what it does and not how it does it. It
is one less place to make a mistake in the future.
    If you choose to not nest include files, make sure you document
what each file needs. AND DOCUMENT IT WELL!!

Mike


--
====================================================================
Michael Johnston
id8rld06 at serss0.fiu.edu or
26793271x at servax.fiu.edu



More information about the Comp.lang.c mailing list