4 ms·
> due to its proper staticaly typed nature I'm not sure what you mean by this - C++ compilation isn't slow because of a lack of static typing :) Here is some
by jacobparker 13y ago
> due to its proper staticaly typed nature
I'm not sure what you mean by this - C++ compilation isn't slow because of a lack of static typing :)
Here is some actual info on the subject: http://www.drdobbs.com/cpp/c-compilation-speed/228701711 http://www.drdobbs.com/cpp/c-compilation-speed/228701711
- raverbashing 13y agoCorrect, the speed has nothing to do with static typing or not. Go is fast to compile as well and statically typed See the post on the C++ preprocessor that was on HN some days ago as well
- Danieru 13y agoMy friend who I'd call the closest thing to a template programmer summarized the situation as such: "The core tenant of C++ has been to move work from runtime to to compile time." Both RAII (avoiding use of new & delete) and generics are strengths of C++ but also require heavy compile time work. RAII needs decent analysis and optimization or your program will thrash copying struts by value. Generics and templates force your compiler to run a second compilation in your frontend. This on top of C's copy/paste based include system and macros gives you what should be one of the slowest to compile procedural languages designable.
- 72deluxe 13y agoRAII doesn't necessarily mean avoiding new and delete. It just means cleaning up in destructors when you use new in the constructor or initialiser list or elsewhere. In particular, RAII means grabbing what you need in the constructor rather than haphazardly creating items in member functions. That's what I thought anyway?