HACKER Q&A
📣 atlacatl_sv

Is C++ a better language than C?


please refer to original question and discussion for better context: https://twitter.com/brouhaha/status/1340919013929529344?s=21


  👤 gradschool Accepted Answer ✓
The advantages of C++ over C that account for its popularity boil down to three main things.

1. It's easier for managers to hire C++ programmers because there are more of them than C programmers.

2. C is designed to trust the programmer more than C++ is. In some organizations, this difference might be advantageous for containing the damage caused by the dumbest team member.

3. It's easier for a developer to appear productive to a manager using C++, especially a non-technical manager, because it requires writing a lot of boilerplate.


👤 AnimalMuppet
If what you're after is simplicity, then no, C++ is not better than C. If that's what you're after, look at Go instead.

But I question the premise. C++ is a more complicated language, which lets you do certain things much more simply than you could in C. (It also lets you make bigger messes.) If you care about doing those kinds of things, then C++ lets your code be simpler, even if the language is more complex.

As always, use only the parts you need, and learn enough about them to use them well.


👤 lmedinas
I guess so, that's why its so popular. Despise of what some people say about it, it tries to make better for all C flaws and introduces modern features to bring continuity to the language.

👤 pasttense01
It depends on where and how you want to use the language.

👤 rangoon626
It makes string handling much easier, that’s for sure.

However I always liked the way Objective C did OPP vs how C++ did it.


👤 krapp
Yes. Function and operator overloading, default arguments and templates alone make it better.

👤 umen
Linus Torvalds don't thinks so