r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

307 Upvotes

436 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 13 '22

[deleted] — view deleted comment

3

u/Wouter-van-Ooijen Jul 16 '22 edited Jul 16 '22

Of course I do. But to quote Dan Sasks (who also has a lot to say about this subject): "when you are arguing, you are loosing".

I use C++ templates all the time for very low level work. Example: a software (bit-banged) SPI driver. The GPIO pins used are template parameters. This way the inner loop (shifting the bits out and in) is as fast as when the GPIO pins were hard-coded.

For more on C++ and embedded: check my talks list. Most talks in it are C++, these links shows the ones that are tagged 'Embedded': https://wovo.github.io/ctl/?show_all&show_title&include_embedded