Re: reduce compilation times?

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

 



--- "J.C. Pizarro" <jcpiza@xxxxxxxxx> wrote:

> On 2007/11/28, Tom St Denis
> <tstdenis@xxxxxxxxxxxxxxxx> wrote:
> > J.C. Pizarro wrote:
> > > On 2007/11/28, Duft Markus
> <Markus.Duft@xxxxxxxxxx> wrote:
> > >
> > >> Hi!
> > >>
> > >> I assume, that all strategies discussed here
> are targeted at C. now what
> > >> about C++, how do things behave there? As far
> as i know C++ is much
> > >> different, and requires completely different
> thinking with regards to
> > >> splitting source in more files, etc.
> > >>
> > >> Cheers, Markus
> > >>
> > >
> > > Your comment is good.
> > >
> > > Splitting C files is different to splitting C++
> files or splitting Java files,
> > > Fortran, Ada, ObjC, ....
> > >
> > > As GCC is made in C-only then we only need to
> split C files to reduce the
> > > recompilation time if we want.
> > >
> > > For other projects made in C++, Java, Fortran,
> Ada, ObjC, ...., they are
> > > hard to split their files.
> > >
> > This is so blatantly false ... I don't know about
> fortran/ada/obj, but
> > for C++ and Java you can trivially factor your
> code.
> 
> It's not false, you get wrong.
> 
No!  Tom got it right!  Had I responded when I first
saw that nonsense, I would have used harsher language
than he did!

I don't use ObjC or Ada, but a fortran project can be
rationally divided among several compilation units, as
can C++.  I have seen fortran library projects in
which there is only one function in most of the
compilation units in the project.  Java requires on
file per class, but you can rationally design your
classes so that each is relatively small.  This allows
a single complex class to make use of a suite of small
classes, so its member functions can often be one or
two lines of code, simply referencing instances and
functions of other classes.  This is easy to do, at
least if you have sufficient experience coding in a
variety of languages!  It comes down to thinking about
your code and how best to implement what you need.

Cheers

Ted

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux