r/cpp_questions • u/kyan100 • Sep 13 '24
OPEN Why Linux community hates C++ so much?
It seems like they have an extreme disliking towards C++. Especially the kernel developers. Linus has even said he doesn't allow C++ in kernel just to keep C++ programmers away. Which sounds very weird because C++ seem to be used in all kinds of complicated systems, and they are fine.
175
Upvotes
153
u/tyler1128 Sep 13 '24 edited Sep 13 '24
C evangelicals really like C. Linus also is a highly opinionated person. Programmers tend to be pretty strongly disposed to defending the languages they like and don't like, too.
C is one of the simplest used languages when it comes to how close it is to the way a processor actually works, and you can interface with a processor pretty close to the way you could in assembly, if you wanted to. This has pros and cons. C++ also allows object oriented programming which itself is fairly divisive, with many systems-level programmers outright hating it. There are reasons for a kernel you wouldn't want to use a language with many abstractions, but C++ is used widely in the Windows kernel, so it is doable.
EDIT: It's used in the userspace of the windows kernel, there are reasons you'd not want to include the full STL as it'd likely make the executable size much larger in ring 0.