Article View: comp.lang.c++.moderated
Article #71Re: Tool for removing surplus #includes
From: John A Hughes
Date: Mon, 04 Mar 1996 18:22
Date: Mon, 04 Mar 1996 18:22
34 lines
2215 bytes
2215 bytes
In article <4h2kto$c9k@netlab.cs.rpi.edu>,
Tony Houghton <tonyh@tcp.co.uk> wrote:
>In article <4gum81$hlk@netlab.cs.rpi.edu>
> nababs@qualcomm.com (Nasser Abbasi) wrote:
>
>> In article <4gj0p3$lp0@solutions.solon.com>, tonyh@tcp.co.uk says...
>> [...desire for a tool to remove surplus #includes...]
>> I think you are trying to save few nanoseconds here from the
>> pre-processor time
>
>It takes more than nanoseconds.
It also generates spurious dependecies that can cause entire files to be
recompiled because a header file they have no interest in has been touched.
If this happens in an unfortunate header file, the results of that can easily
propagate through large parts of your project and waste kiloseconds.
A file should contain exactly the header files it depends on, no more and
no less. If removing a #include causes you to add it somewhere else, you
were relying on a non-local and confusing inclusion structure anyway, which
you should be thrilled to have exposed. And why should one expect changing
a header file not to "break" code that includes it anyway?
I *hate* it when people give me libraries that insist I include something in
order to include their file, or have to put includes in a certain order. It's
stupid and unnecessary if you follow the simple rule above.
jah
[ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
[ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
[ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
[ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
Technical Details
Message-ID:
<4hfccd$jun@netlab.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!kbad.eglin.af.mil!rpi!not-for-mailReferences:
<4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu> <4h2kto$c9k@netlab.cs.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!kbad.eglin.af.mil!rpi!not-for-mail From: jah@cais.cais.com (John A Hughes) Newsgroups: comp.lang.c++.moderated,comp.lang.c Subject: Re: Tool for removing surplus #includes Date: 4 Mar 1996 18:22:05 -0000 Organization: Capital Area Internet Service info@cais.com 703-448-4470 Sender: cppmods@netlab.cs.rpi.edu Approved: Dietmar.Kuehl@uni-konstanz.de Message-ID: <4hfccd$jun@netlab.cs.rpi.edu> References: <4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu> <4h2kto$c9k@netlab.cs.rpi.edu> NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: 4 Mar 1996 17:07:44 GMT