I think there are very few places where C makes sense and C++ doesn't. Its mostly legacy things like the Linux Kernel, or more aesthetic projects like demoscene or suckless. Where its easier to agree to write C instead of trying to agree on what subset of C++ to use (even then its usually C with a mishmash of C++ ergonomics)
That said, leafing through the first chapters of "Expert C Programming" should dissuade anyone of the idea that C is a simple language. It'll leave you amazed anyone's been able to write working programs in it
That said, leafing through the first chapters of "Expert C Programming" should dissuade anyone of the idea that C is a simple language. It'll leave you amazed anyone's been able to write working programs in it
What footguns are present in C bit not in C++?
C++ has all the footguns from C and adds multiple more. C++ is not a replacement for C, in the same way that a spacecraft is not a replacement for a Cessna.
"Correct" modern C++ eliminates whole classes of problems. You can of course still write C code, but no one would merge that in to their codebase
That requires the programmer to practice discipline. If someone needs something better than C, there's alternatives to C++ that don't require "Programmer needs to be disciplined".
Theyre both complicated languages in their own way :)
No. C++ is, without doubt, the most complicated language there is. Nothing else, not Java, C#, Rust, etc comes even close.
C, OTOH, is simple enough that implementing it is practical even for students. The number of footguns are a handful.
They are severe, but not numerous. C++ has both numerous and severe footguns.
Comments
I think there are very few places where C makes sense and C++ doesn't. Its mostly legacy things like the Linux Kernel, or more aesthetic projects like demoscene or suckless. Where its easier to agree to write C instead of trying to agree on what subset of C++ to use (even then its usually C with a mishmash of C++ ergonomics)
That said, leafing through the first chapters of "Expert C Programming" should dissuade anyone of the idea that C is a simple language. It'll leave you amazed anyone's been able to write working programs in it
What footguns are present in C bit not in C++?
C++ has all the footguns from C and adds multiple more. C++ is not a replacement for C, in the same way that a spacecraft is not a replacement for a Cessna.
"Correct" modern C++ eliminates whole classes of problems. You can of course still write C code, but no one would merge that in to their codebase
Theyre both complicated languages in their own way :)
That requires the programmer to practice discipline. If someone needs something better than C, there's alternatives to C++ that don't require "Programmer needs to be disciplined".
No. C++ is, without doubt, the most complicated language there is. Nothing else, not Java, C#, Rust, etc comes even close.
C, OTOH, is simple enough that implementing it is practical even for students. The number of footguns are a handful.
They are severe, but not numerous. C++ has both numerous and severe footguns.
Unfortunately plenty of folks do merge it into their codebases, including at companies that seat on WG 21, easily found on their Github projects.