r/cpp • • Jul 13 '22

Why does Linus hate C++ ?

308 Upvotes

436 comments sorted by

View all comments

26

u/MrRubberDucky Jul 13 '22

35

u/Mason-B Jul 13 '22

That was 15 years ago. C++ is a different language now, twice over. C++11/14/17 was an entirely new, more stable and better defined, C++ standard that made effectively a new language. And C++20/23/etc appears to be a repeat performance.

And also, Linus is a different person. He went to some sort of anger therapy for 3 months in there and stopped yelling at and insulting people. These days he's also letting Rust in with conditions.

I suspect if there was a concentrated push to get C++ into the kernel today it wouldn't be the same story.

-2

u/top_logger Jul 13 '22

OOP + exceptions + STL = bad idea for kernel even in C++20(which is still not fully available now).

I find C++ great, still you need good engineers and kind of reality understanding.

33

u/Mason-B Jul 13 '22 edited Jul 13 '22

Every single thing you listed there is optional (if we understand "OOP" as virtual methods/inheritance, which is how people generally mean it). While on the topic, Rust's abort mechanism also doesn't fly for exceptions in a kernel either.

Any language being used in a kernel environment will necessarily be restricted and modified. Neither C++, nor Rust, nor even C escape that. Listing optional features as problems isn't a sane counter example.

→ More replies (4)