K
K
Kukunin2012-11-02 15:55:58
C++ / C#
Kukunin, 2012-11-02 15:55:58

Why doesn't Linus like C++?

In view of the recent topic about " C with classes ", there was a link in the comments to a letter from Linux, where he answered the question "Git in C ++" and severely criticized C ++.
After all, there's nothing C can do that C++ can't (and I'm sure the other way around, too), but a lot of things C++ does in a much simpler and more elegant way.
As for cross-platform, I can’t say for sure, C ++ programs require an additional libstdc ++. But it doesn't seem to be a problem.
So why do hardcore C fans dislike C++ so much?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
L
lesha_penguin, 2012-11-02
@lesha_penguin

<Thinking out loud>If there is a special "hell for shitty coders", then surely one of the harshest punishments in it would be debugging the shitty code that C++ produces on the principle of "become simpler and more elegant".</Thinking out loud>
If we start "from the creation of the world":
1) As you know, C ++ was invented by Stroustrup, we will not belittle his “scientific regalia” (there are a lot of scientists’ awards, but they are essentially the only thing that a person “achieved”, by the way, 90% directly or indirectly for c ++). However, we note that Stroustrup is just an example of a “pure theorist” (in contrast to the “practitioner” - Torvalds), i.e. is a person who has not taken part in the development of any serious real software project in his life. In fact, the c ++ compiler is the only more or less practical thing in his life. Accordingly, he has a very mediocre idea of ​​what problems he has to face in real "software development" from the "height of his OOP theories".
2) As rightly noted, in the mentioned article, initially it was just “Tse with classes”, i.e. initially NOT MORE THAN an "academic" attempt to wrap individual elements of "objectivity" into C (like Smalltalk is object, but let's try to do this at a lower level). By the way, I can tell you that I first got acquainted with C++ in the 80-90s, when Fortran was the language of the “academic environment”, C was the language of “system engineers”, and Basic and Pascal were used to teach “all non-core specialties” the basics of programming. Yes, but it’s true that “then C++ 80” was different from the current one - it really gave the impression of “just a cool craft” (I remember that, for example, then there wasn’t even half of the usual functionality, for example, things like all sorts of “reinterpret_casts” or namespac- ov.). By the way, yes… drumroll… THERE WAS NO STL!!!
3) Probably Stroustrupovsky "Tse with classes", probably would have remained in the list of "cool crafts" in the anals of history , if not for one circumstance: "SUDDENLY" there was a "software boom", respectively: a) "elite" "old school" there was a sharp shortage of programmers b) “software quality requirements” fell sharply c) a tool was needed to generate a fairly low-level “shit code on an industrial scale”. And oddly enough, (yeah, you guessed it, it was with the advent of STL-I in C ++) C ++ was thrown into the abyss of the "mainstream" without getting rid of its "academic sores".
4) You are being told the truth when they say "C++" is marketingname for "Tse with classes". Yes it is. And we can say, unfortunately, he found his market niche. (Now any fool can easily "learn C++ in 21 days (with boost and stlem)", while not even being able to clearly answer the simple question "If you're so smart, then explain why, [email protected], your program flows on memory and falls”, (about such “politically incorrect questions” as “why write 100 lines on what is written in two or three”, we are generally tactfully silent, otherwise, you never know, a person can have a “piecework salary” for the amount lines ;) ), but with the look of a cool Bear Gryls, you can discuss such "high matters" as "Patterns" and "pure OOP").
5) And most unfortunately, in some cases there is no alternative. Yes, I have not yet met a single programmer who is in really real software developmentI would actively use C ++ and at the same time I would not spit on it . C++ has a "HUGE PLUS" - Its Multiparadigm! In fact, this is its only plus, which allows you to “not go into the wilds” (such as trying to shove “main()” into an object just for the sake of the “idea of ​​pure OOP”)!
6) And now, after such a “historical” introduction, once again carefully reread Torvalds’ letter, the statement of a person who knows better than many “pure OOP theorists” how it is to develop complex systems “on his own skin”, and comments from habrausers who are “on the live practice "know" how much a pound is dashing "in the topic . Under most of the statements, I personally would put my signature in gold letters.

M
mejedi, 2012-11-02
@mejedi

The problem is not the quality of the language, but the quality of the programmers.
Here's why they don't like it:
1) A spherical C++ programmer doesn't know data structures - STL does everything for him.
2) The spherical C++ programmer carelessly allocates memory.
3) The program of a spherical C++ programmer does not work without boost.
4) A spherical C++ programmer makes simple things difficult .

K
kaladhara, 2012-11-02
@kaladhara

Let's draw an analogy: why do Zenith fans dislike Real Madrid fans?
After all, all football players do the same thing: they quickly move their feet and kick the ball.
Answer: because such is the ape nature of man.

S
Stdit, 2012-11-02
@Stdit

In the same letter, Linus gives his answers. He writes system software, and C++, in his opinion, provokes the use of libraries (including STL), resulting in inefficient code (and which can only be fixed by rewriting). In addition, C code is more portable, and it is much more common to find programmers who understand low-level nuances among sischnikov.

A
AGvin, 2012-11-02
@AGvin

He described his “love” for Git in the man, not bad)
By doing:

[[email protected] etc]#man git

We see:
Name
  git - the stupid content tracker

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question