Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>C++ is so slow to compile as the header files have to be reread and reparse every time they are included. Due to the way “#defines” work, it is very hard for a compiler to automatically pre-compile all header files. (Modula-2 made a much better job of this) Having 100s of headers read for each C++ file that is compiled is normal on a lot of C++ projects.</p> <p>Sometimes incremental c++ compiles can be a lot faster than C#. If you have all your C++ header files (and design) in a very good state (see books like <a href="http://rads.stackoverflow.com/amzn/click/0201633620" rel="nofollow noreferrer">Large-Scale C++ Software Design</a>, <a href="http://rads.stackoverflow.com/amzn/click/0321334876" rel="nofollow noreferrer">Effective C++</a>) You can make a change to the implementation of a class that is used by most of the system and only have one dll recompile.</p> <p>As C# does not have separate header files whenever you change the implantation of a class, all uses of the class get recompiled even if the public interface of the class has not changed. This can be reduced in C# by using “interface based programming” and “dependency injection” etc. But it is still a pain.</p> <p>However on the whole I find that C# compiles fast enough, but large C++ projects are so slow to compile that I find myself not wanting to add a methods to a “base class” due to the time of the rebuild.</p> <p>Having lots of Visual Studio projects with a handful of classes in each can slow down C# builds a lot. Combining related projects together and then “trusting” the developers not to use class that are private to a namespace can at times have a great benefit. (<a href="http://www.ndepend.com/" rel="nofollow noreferrer">nDepends</a> can be used to check for people breaking the rules)</p> <p>(When trying to speed up C++ compiles I have found FileMon very useful. One project I worked on, the STL was added to a header file and the build got a lot slower. Just adding STL to the precompiled header file made a big difference! Therefore track your build time and investigate when it gets slower)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload