3 ms·
It is extremely easy to let your C++ code get into long build times. People get fond of putting code into the header, for example. This adds that compile time t
by zlynx 6y ago
It is extremely easy to let your C++ code get into long build times. People get fond of putting code into the header, for example. This adds that compile time to every file that includes that file. And it prevents you from using forward declaration, which then requires including those definitions in your header.
With discipline and tracking the build time, and tools that record how long each build step takes, you can keep people from doing things like declaring a Boost multimap in a header file. They can go ahead and use it but hide it in a cpp source file behind a pointer or a virtual interface.
I've noticed that some people fall in love with C++11 move constructors, and they are pretty cool, but unlike a reference or pointer they require full type definitions in order to pass "by value." So that's annoying.
C code is definitely faster to build, unless you've got some crazy programmer who reimplemented C++ templates using five level deep nested macros.