News for hackers. Stuff that matters.
Re:Why should I have written ZeroMQ in C, not C++ (2012) by AlexandrB on Thursday May 21, 2015 @01:10AM (#9581053)
C++ not only fails to hide the above-mentioned C pitfalls but adds entire classes of pitfalls of its own. Just a few examples:

* undecidable grammar: http://yosefk.com/c++fqa/defective.html#defect-2

* const inside containers: http://yosefk.com/c++fqa/const.html#fqa-18.1

* template error messages http://yosefk.com/c++fqa/templates.html#fqa-35.17

C is often nicer than C++ because it's simpler: it only has the C pitfalls not the combination of C & C++ pitfalls that plague C++.

Re:Why should I have written ZeroMQ in C, not C++ (2012) by vitaut on Thursday May 21, 2015 @01:39AM (#9581132)
These are trivial issues compared to major safety and usability flaws inherited from C that I mentioned. BTW the C grammar is not context-free either. The compilation speed is mostly due to header system which is again a C heritage, not because the C++ grammar is undecidable. And template error messages are much better now in modern compilers such as Clang. As for the const, its semantics is the same as in C.
Re:Why should I have written ZeroMQ in C, not C++ (2012) by the_why_of_y on Thursday May 21, 2015 @07:21PM (#9585940)
The super-slow compilation speed is mostly because C++ encourages massive all-inline template libraries like the standard C++ library and boost, which need to be parsed and have the used templates instantiated for every compilation unit.

Here's idiomatic hello world, with <iostream> vs. <stdio.h>

> g++ -E hello.cc | wc -l

17906

> gcc -E hello.c | wc -l

842