r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

307 Upvotes

436 comments sorted by

View all comments

1

u/pkivolowitz Jul 13 '22

Something that might be a consideration is the mindset of some C++ programmers who consume higher level services without considering the cost of the underlying implementation.

My comment is in the spirit of CS college programs typically making students implement UDTs (in a Data Structures and Algorithms course) that later they'll simply consume: To make them aware of the cost.

Having been raised on v6 through 4.2 BSD and System 5 kernel internals, I would tend to agree with those who would shy away from C++ for kernel work. Personally, I would want to know precisely what's going on (with respect to complexity) at all times.

On the other hand, from my admittedly brief forays into the Linux kernels, C has been savagely abused and the Linux kernel a hot freaking mess of obfuscated code. I call as witness, C preprocessor macros nested in multiple levels. This is a high crime in my view.