Linus Torvalds: “C++ is really a terrible language!”

Linus Torvalds: “C++ is really a terrible language!”

He’s here! Linus is here again with his “violent temper”!

Recently, Rust’s decision to enter the Linux kernel has been officially put on the agenda. Last week, its kernel developer Miguel Ojeda submitted an RFC to add Rust support to the Linux kernel, which caused heated discussion.

Regarding this matter, many people naturally want to know the views of Linus Torvalds, the father of Linux. After all, this is the first time that Linux has added a second programming language other than C to its kernel in so many years. Therefore, the foreign media IT Wire interviewed Linus on this issue.

At first, he was more “reserved”, but rather officially responded that the Linux kernel’s support for Rust is still in the early stage, and the relevant patches may not be merged until the 5.14 version.

But after knowing that some developers thought that “C++ should be used instead of Rust”, Linus’s “temper” finally couldn’t hide.

He laughed and sarcastically said: “C++ is such a bad language!”

For more than ten years, Linus insist on standing on the front line of bombarding C++

If Linus’s “love” for Linux has not changed in the past thirty years, then his “hate” for C++ can also be said to have lasted more than ten years.

He started bombarding C++ as early as 2007.

At that time, a developer named Dmitry Kakurin checked the Git source code and found that it was using pure C instead of C++. He said that he was incomprehensible, so he posted: “Don’t talk about portability, this is nonsense (the original word here is BS, or bullshit).”

Good guy, the word “BS” directly denoted Linus’ bomb temper.

Has always been known to be sharp-tongued, he even gave Nvidia the middle finger. Not even shy about swearing, he returned to hate the first sentence on the “eye for an eye person in his body”: “YOU are Full of bullshit .”

After avenging the “BS”, Linus then criticized C++ for nothing: “C++ is a terrible language”, “A lot of unqualified programmers are using it”, “I will not use C++ and programmers who develop projects instead of C are kicked out, lest they mess up the projects I’m involved in”, “C++ ended up with a bunch of terrible, unmaintainable garbage”…

Since then, Linus and C++ have been completely competitive.

This is not over yet. In 2010, Linus posted a series of C++ messages on the mailing list. According to him, C++ is really a terrible language. He said that no matter what C++ is not the most correct choice: C can be used directly in-system programming, it is best to choose a language with garbage collection, but the characteristics of C++ are basically useless.

He also mocked C++’s new keyword for being stupid, thinking that “C++ is just a waste, there is no design at all, just adding some scum on top of C.”

This interview is the first time Linus has bombarded C++ in public after many years.

C++ was criticized again as “bad”

This time, Linus once again bombarded C++ in a comment by netizen @mss on the Linux Weekly News website:

The solution is simple: just use C++ instead of Rust.

When the code calls unsafe functions, the memory safety of Rust cannot be guaranteed, and currently, almost all kernel APIs are in it. However, you can also easily use C++ for such manual markup.

Since everyone can speak, especially in the current Internet age, netizens speak more freely. Which programming language is better is naturally “the benevolent see benevolence, and the wise see wisdom”.

But this is different for Linus. He has always regarded C++ as “waste” and considered it “useless”. As a result, some people think that Rust, which they carefully selected to enter the Linux kernel is not as good as C++.

So Linus, who heard this comment, did not control the sneer. He said contemptuously: “C++ can’t solve the problem of the C language at all, it will only make things worse. This is a really bad language.”

He believes that those who dislike the C language can look for a language that can really bring you value. For example, languages ​​that have memory safety and can avoid hidden dangers caused by C, or languages ​​that have internal GC (garbage collection) support and simplify memory management. And this language is obviously not C++, because, in Linus’s view, C++ solves all the wrong problems, so those who say “rewrite the kernel in C++” are too ignorant.

Compared with C++, Linus chose to unconditionally stand on the C side. “When people talk about the dangers caused by C, they also talk about a part of the reason C is so powerful:’It allows you to efficiently implement all these low-level things.’” Linus mentioned. Also, although GC is a good thing to simplify programming in most cases, it is usually not something you can do in low-level system programming.

Netizen: C++ is not rubbish

I believe you can often see many people arguing about the topic of “best programming language” on the Internet, but with time, more and more programming languages ​​have emerged, and most people are aware of the fact: each programming language ​​has its own limitations and its best uses.

Therefore, this time Linus scolded C++ as “useless”, which attracted protests from many developers.

This time Linus offended the C++ programmer again, but his “temper temper” hasn’t changed much over the years. Perhaps just like the programming language, Linus’s “hotness” is also the “good heart” of some developers!