Why C++ compiles slowly

dsimcha dsimcha at yahoo.com
Thu Aug 19 09:18:07 PDT 2010


== Quote from Leandro Lucarella (luca at llucax.com.ar)'s article
> I know you can do separate compilation as in C/C++ writing the
> declarations in a different file, or generating/using .di files, but
> also you'll probably end up using libraries that don't do that (as
> somebody mentioned for C++ + STL) and end up in a dependency madness
> anyway. It's just not natural to do so in D, it even encourages not
> doing it as one of the main advertised features is you don't have to
> separate declarations from definitions.
> And I'm not saying that is an easy to solve problem, I'm just saying
> that I agree D doesn't scale well in terms of incremental compilations
> for big projects, unless you go against D natural way on doing things.

I think this is a perfectly reasonable design principle.  Sometimes you have to
resort to things that are ugly, unsafe, a PITA, etc. to deal with some practical
reality.  What D gets right is that you shouldn't have to be burdened with it when
you don't need it, and the simple, clean, safe way that works most of the time
should be the idiomatic way, but the ugly/unsafe/inconvenient way that works in
the corner cases should be available, even if no serious effort is put into making
it not ugly/unsafe/inconvenient.

Languages like C++ and Java tend to ignore the simple, common case and force you
to do things the hard way all the time, even when you don't need the benefits of
doing things the hard way.  Thus, these languages are utterly useless for anything
but huge, enterprisey projects.


More information about the Digitalmars-d mailing list