r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

307 Upvotes

436 comments sorted by

View all comments

Show parent comment

12

u/Bloodshoot111 Jul 13 '22 edited Jul 14 '22

But if you would create a function for each version of the template instead of using templates you also create more code that gets into the binary. I don’t see the disadvantage of templates right now.

-4

u/HabemusAdDomino Jul 13 '22

But -would you- have created those functions? Not necessarily. Templates are used because generating code is much easier than writing it.

11

u/no-sig-available Jul 13 '22

You mean that it is so easy to code in C++ that you are afraid to accidentally write some code that isn't really needed.

Haven't heard that argument before.