[prog] [C/C++] what to put in header files.
Terri Oda
terri at zone12.com
Wed Sep 18 17:35:27 EST 2002
> I'm wondering if there are some common rules how to organize
> the header files, or if people are so used to grepping anyway that
> it doesn't matter where to put things.
My experience so far is that rules of how to organize things differ from
organization to organization. In the places I've worked, I've seen pretty
varied coding standards (documented) and coding practices (not usually
documented except by reading source, and not necessarily lined up with the
coding standard). I've worked with code that was probably 15 years old, and
darned if the coding practices were even close to the same then as now, so I
couldn't really expect the headers to be organized in the same way.
So as an experienced programmer, I *do* always grep. :)
Basically, the only rules I've seen consistantly are "be consistant" and
"Don't edit the things that say don't edit, since our scripts use those to
<generate rudimentary documentation, generate the rest of the header file,
etc.>"
If you're looking for an established rule to use for yourself, I recommend
looking at some coding standards. They're usually reasonably well thought
out and worth looking at even if you don't want to use any particular one.
Terri
More information about the Programming
mailing list