My advice on implementing stuff in C:
My advice on implementing stuff in C:
Posted Oct 15, 2010 18:22 UTC (Fri) by chad.netzer (subscriber, #4257)In reply to: My advice on implementing stuff in C: by HelloWorld
Parent article: Russell: On C Library Implementation
That suggestion seems overly condescending.
> (at least not low level programming, which is what C++ is about).
I assert that "low level programming" is *not* what C++ is about. Modern C++ style recommends that you use smart pointers, rather than C pointers, for example. Nor should you be using C strings, C arrays, C structures, C stdlib functions, C-like error handling, C macros, etc. Basically, modern C++ encourages using full high-level abstractions for data structures and algorithms, and is thus, fundamentally, high-level. And when all these new features and abstractions are used properly, it can be a beautiful, elegant thing IMO (that takes a lot of time and memory to compile). But it's not low-level.
The fact that many people still want to use C++ as only "a better C" (ie. no exceptions, multiple inheritance, namespaces, virtual functions, the stdlib, RTTI, or even templates and RAII), and thus *not* use the new features added in the last 15 years, is a direct consequence of many of those features being "insanely complex".
But the C++ FAQ, and C++ FQA make both ends of this argument in a more elegant fashion than I can:
http://www.parashift.com/c++-faq-lite/index.html
http://yosefk.com/c++fqa/
Note how rarely the FAQ mentions pointers, btw.
