Re: New versions of VC++ still stuck with function prototypes?

From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 03/27/05


Date: Sun, 27 Mar 2005 08:40:56 -0800

Andre Kaufmann wrote:
> Arnaud Debaene wrote:
>> _R wrote:
>>
>>> Given that VS2005 has made an effort to clean up the syntax of VC++
>>> (in C++/CLI), is there any future plans to do away with function
>>> protos, ala C#/VB?
>>
>> You mean remove the header files? I hope they will never do it!
>>
>
> I hope they will (try to) support that in a future standard, since
> that could drastically improve compilation speed.

Of course it wouldn't. The thing that can (and does) drastically improve
compilation time is a clean separation of interface from implementation.
This separation can be accomplished through properly designed header files,
but it's really an extra-lingual hack. As you point out below, IBM's Visual
Age C++ product made an attempt at providing a cleaner module definition for
C++, but so far no such definition has gained momentum in the C++ community.

> Donīt get me wrong, i love C++ in many aspects, but sometimes i still
> prefer other languages because of compilation speed.
> If my C# project with 200 units compiles faster completely than a
> single C++ unit of my project with also 200 units and header files what is
> the advantage of a clear separation in 2 files ?

It would be nice if that were so, but in my experience, it isn't. One
project I work on regularly is a C# application consisting of around 2000
classes (and files). The fact that the time to do a Build after a minor
change of a leaf class is nearly the same as the time to do a Rebuild of the
entire app deomnstrates that C# does not have an effective incremental build
system.

The same application in C++ would, I strongly suspect, handle incremental
builds after minor changes much more quickly than C# does, while a full
rebuild would likely take significantly longer due to the increased language
complexity.

I too hope that some day a good clean module concept is created for C++ and
promulgated through the standards organization. Personally, I don't hold
out much hope that it'll ever happen, but you never know. There's so much
tradition in C and C++ that's based around the idea of sequential processing
of text files to produce a compiled applicaiton that it'll be hard to break
away. I expect that we'll see a new language with the expressiveness of C++
but with a clean module concept before we see such featues in standar C++.

-cd



Relevant Pages

  • Re: Compilation errors in Standard header files
    ... >errors in standard header files supplied by VC++ like stdlib.h, ... >When I write a simple C file, its not giving these compilation erros. ... >C2226: syntax error: unexpected type 'T' ... >C2062: type 'const int' unexpected ...
    (microsoft.public.vc.language)
  • Re: New versions of VC++ still stuck with function prototypes?
    ... could drastically improve compilation speed. ... better separation than the other languages. ... interface section and one implementation section. ... precompiled header files to speed up compilation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: metapost or something? Coordinate system - transformation with cosine...
    ... hmm. ... @q ** Compilation. ... That's CWEB, but you don't really need it. ... GCC looks through the path for header files specified on your system, ...
    (comp.text.tex)
  • Re: New versions of VC++ still stuck with function prototypes?
    ... > that could drastically improve compilation speed. ... you've got nothing to separate a class interface from implementation. ... Concerning templates, ... > precompiled header files to speed up compilation. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: A C++ Whishlist
    ... > usability that do not involve modifying the language itself. ... It just adds complexity without functionality to have struct ... As for header files, apparently you don't comple very large applications. ... (No idea what those are, with regards to programming, at least.) ...
    (comp.lang.cpp)