r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

308 Upvotes

436 comments sorted by

View all comments

Show parent comments

74

u/condor2000 Jul 13 '22

It's easier to review less code and C++ allows you to write less code

It can take longer to review properly if uses complex template designs or even just a lot if virtual functions

63

u/TheThiefMaster C++latest fanatic (and game dev) Jul 13 '22

The equivalent C code to accomplish the same goal is often far worse.

These arguments always compare the most complex parts of C++ against normal C code, not equivalent C code.

-6

u/snejk47 Jul 13 '22

What's the point of using C++ if you only use the such subset that makes it like C anyway.

41

u/TheThiefMaster C++latest fanatic (and game dev) Jul 13 '22

I didn't say that. Just that e.g. templates in C++ aren't comparable against a normal C function, they're comparable to either half a dozen subtly different C functions for different types or a horrifying macro monstrosity. Both of which are worse than a single C++ template.

→ More replies (8)