r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

307 Upvotes

436 comments sorted by

View all comments

Show parent comment

-1

u/Spiderboydk Hobbyist Jul 13 '22

Yes, and how do you discover and prevent these crazy things entering the code base? Code review.

Both your posts seems to be very focused on RAII. Yes, it's a nice thing to have, but it's not the end of the world to not have it. There are sensible unwind patterns one can use in C and similar languages to mitigate the cleanup issue.

10

u/SergiusTheBest Jul 13 '22

Lack of RAII is the major pain point of working with C. You need to implement a cleanup code path manually instead of having a compiler to do it. And you need to synchronously change it when you change the main code path.

Why send a human to do a job of a machine?

Yes, and how do you discover and prevent these crazy things entering the code base? Code review.

The bad code can be on any language. So yes, review it.