[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Header cleanliness [was: removing the 'make install'-->'makeall' de

From: Alexander Malmberg
Subject: Re: Header cleanliness [was: removing the 'make install'-->'makeall' dependency]
Date: Wed, 11 Dec 2002 16:43:19 +0100

And since the subject's been brought up...

Nicola Pero wrote:
> I'm personally waiting eagerly for precompiled headers to be
> included/merged into FSF gcc ... :-)
> ... that would be really cool, and possibly, finally, cut down the
> measurable build overhead generated by including almost any AppKit/*.h
> under GNUstep (because almost in all cases, this ends up including the
> front-end/back-end optimized interface which is a lot of inline functions,
> and takes quite some time to compile).

For this (and a few other reasons), 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

* A header must be self-contained. If it needs any definition from
another header, it must include it itself. To catch violations of this
(which are very annoying, and I know from experience that it's easy to
just include some extra headers in your app/tool until it works and then
forget about it instead of fixing it), each .m file should include its
corresponding header before doing anything else.

* A header should include as few other headers as possible. Use @class
instead. This speeds up compilation, doesn't pollute the user's
namespace, and doesn't break things when a header suddenly stops
including some other header (I've been bitten by this as well; better to
sort it all out at once).

Comments welcome.

- Alexander Malmberg

reply via email to

[Prev in Thread] Current Thread [Next in Thread]