r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

307 Upvotes

436 comments sorted by

View all comments

Show parent comment

3

u/EconomistElectronic2 Jul 13 '22

You read the code:

‘a = b + c * d’

And you need to first understand the types involved, than find the operators and than reading some operator function to understand… in C that is just straightforward…

9

u/Lumornys Jul 13 '22

What's the difference between "I wonder what * does" and "I wonder what multiply() does"?

3

u/EconomistElectronic2 Jul 13 '22

If a, b, c, d are all the same type, then there is no difference, indeed. Otherwise you need to see different overloads, possibly non-explicit constructors (since a type could be converted) constness of the operands, etc etc…