3 ms·
...because large-scale C projects end up reinventing C++ features in a more complicated, error-prone way. C++ is much more expressive than C. It can compete on
by blub 16y ago
...because large-scale C projects end up reinventing C++ features in a more complicated, error-prone way.
C++ is much more expressive than C. It can compete on equal terms with other high-level OO languages, it has some functional features and it contains all of C.
On the downside, it's difficult to learn and takes much time to become proficient in.
Once you become proficient there's no contest.
- boris 16y agobecause large-scale C projects end up reinventing C++ features in a more complicated, error-prone way You are spot on. Here is an excerpt from a blog post on writing a GCC plugin: The GCC AST itself is a curious data structure in that it is an implementation of the polymorphic data type idea in C (next time someone tells you that polymorphism works perfectly in C and they don’t need “bloated” C++ for that, show them the GCC AST). The base “handle” for all the AST nodes is the tree pointer type. Because the actual nodes can be of some “extended” types, access to the data stored in the AST nodes is done via macros. All such macros are spelled in capital letters and normally perform two operations: they check that the actual node type is compatible with the request and, if so, they return the data requested. http://www.codesynthesis.com/~boris/blog/2010/05/10/parsing-cxx-with-gcc-plugin-part-2/ http://www.codesynthesis.com/~boris/blog/2010/05/10/parsing-...
- yason 16y agoIt takes some overhead to implement the most essential C++ stuff in a C project. After that, the expressibility of these two languages effectively converge. That is, the will be differing factors but those factors won't be an order-of-magnitude different. Hence, it would make sense to start with C++ in the first place, if only possible, because you will immediately save some months of C coding. However, on any large project the overhead becomes negligible. For example, gcc already has the C codebase written for decades. The new allowed development language ought to offer not only more power but a lot more power.