Hacker News new | ask | show | jobs
by gonehome 4972 days ago
Why C as opposed to C++?

I'd love to know because my current understanding is that C++ has the same performance as C, but includes the STL which prevents you from having to reimplement more convenient data structures that handle memory nicely (like vectors) yourself.

The ability to create classes/objects is nice too and the language doesn't take away any of the freedom you're given in C either.

Am I missing something about it? Is it just more familiarity with the older language that makes it more comfortable?

1 comments

For the same code, C++ is generally measurably slower. One reason is how exceptions, which are not optional, are handled at run time.

Having written some seriously high-throughput low-latency code in C++, you have to turn on bunches of compile flags (e.g., ignore exceptions) to get the best out of it.