Hacker News new | ask | show | jobs
by lelanthran 29 days ago
> 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.

1 comments

"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 :)

> "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.

Unfortunately plenty of folks do merge it into their codebases, including at companies that seat on WG 21, easily found on their Github projects.