[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Header cleanliness
From: |
Alexander Malmberg |
Subject: |
Re: Header cleanliness |
Date: |
Thu, 02 Jan 2003 12:24:24 +0100 |
Markus Hitter wrote:
>
> Am Dienstag, 17.12.02 um 01:56 Uhr schrieb Alexander Malmberg:
>
> > ... I've been thinking about writing up
> > a proposed addition to the GNUstep coding standards. I haven't written
> > it properly yet, but in short, I'd like to codify this (for public
> > headers): ...
>
> Hi Alexander,
>
> did you already?
No. I wanted to get some feedback on the idea first, especially the
"each file includes it's header before _any_ other headers part", since
it involves changing a lot of existing files. Didn't get much feedback
on that part, though, so maybe everyone thought it was ok.
> In the GDL2 project, we are trying to get clean headers, but this might
> get a lengthy discussion. Currently, we're patching back and forth,
> producing more CVS conflicts than code ;-)
I was hoping to avoid that. :)
> To shorten discussion, a standard, or even an announcement of an
> standard might be very helpful.
>
> Other topics I didn't see so far:
>
> - How to distinguish between a compiler supporting precompiled headers,
> if at all?
I'd prefer "not at all" (imho, it should be completely transparent), but
I guess that might not always be possible.
> - the preferred order of inclusion (corresponding header, project-wide
> headers, system-wide headers, standard heads) .
For public stuff, I want the corresponding header first. Other than
that, I think having strict rules is overkill :).
To make it easier to see if a particular header is included, I tend to
bunch headers from one library together (sometimes alphabetically to
make searching even easier), often in the order: system, Foundation/*,
AppKit/*, other libraries, project. That's mostly personal opinion,
though. :)
> - wether to use #import or #include
I'd say #include. Either way, I think public headers should be
#include-safe.
> Before diving deeper into the materia I thought it's better to ask ...
>
> Have fun,
> Markus
- Alexander Malmberg
- Re: Header cleanliness,
Alexander Malmberg <=