Re: Rust & Linus Torvalds: 'C++ solves _none_ of the C issues …. It really is a crap language'.

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Modern C++ provides many enhancements over C and previous versions of C++. It offers more productivity and safety, while still producing much faster and efficient code. Linus is stuck in his own world and rarely ventures beyond the comforts of his own ignorance. Git's clearly demonstrates this. Like C, its user interface it trades off usability for user control. He's unable to strike a balance between the two because he never cared what end users thought.

bobweiram
Автор

With all things considered. I'm just grateful that he gave us two amazing things:
1.) Linux (Linux kernel)
2.) Git (an absolutely amazing tool)

jonsunderland
Автор

I personally use C++ a lot and I would rather use C++ instead of C, BUT I totally can understand his point. There are many things that are outright bad in C, which C++ did not bother to address and they never will. This is because they still want be able to compile a C project from 1980 in 2050 with a C++ Compiler without any changes. I would rather have a better language in 2050 that solved long standing problems than the ability to compile a 70y old program. So C++ provides different tools, some which do not have the same problem as the C versions, but some also bring their own problems... Also Linus does not want 5 different paradigms, which makes understanding the code harder, what is so hard to understand there?

JanSordid
Автор

Modern C++ isn't a bad language. It just has a lot of things you should never use and an even larger amount of things that you should have a really really good reason if you are gonna use them.

The issue with the language is that it contains everything and the kitchen sink. People often learn and use a bad subset of that. Programming C++ is a C like style can give you the niceties of both languages.

brendanhansknecht
Автор

I like Rust over C/++ for the same reason I like Typescript over Javascript.
Having to strictly 'define' how I handle memory is just an extension of what makes strict typing so great. I can get why someone who's used Javascript for years would feel that Typescript is 'restrictive' and 'limits the programmer' and 'doesn't trust them to write good code' or what have you, but I think there's a reason both Typescript and Rust completely outperform their 'counterparts' in Stack Overflow happiness surveys.

kinoweiss
Автор

Linus only made operating systems, where coding in C is sufficient as an OS is mainly a collection of independent functinoalities. If he would ever make a complex video game, he would realize why C++ can justify its existence.

SnakeEngine
Автор

Bruh that pic of Linus in the article has me actually dying what the fuck is that lmaoo

BakelitTV
Автор

Linus is perhaps a little (or a lot) out of touch. The obvious solution is to only use the parts you like. At least that occurred to me. On microcontrollers I write C, except for templates and classes, which can have major readability and dev time improvements. You don't want to do inheritance and vtables there anyway.

gunt-her
Автор

OOP languages like c++ have their place, but for an operating system you can get a lot of abstraction and in the end, you won't have much understanding of what is happening, and it's harder to read. I would prefer to write 2x the amount of code but know what is going on, rather than having entangled abstraction layers on complex matters. C++ is awesome for creating gaming engines in my opinion, where most of the things that you have to replicate from the real world are abstract like light and hit detection.

tru-bo
Автор

C++ is just a tool. And like any other tool It's good enough for some gifted to create masterpieces with it, while others shrug and call it a pile of horse manure. That's life, really.

Prtenshke
Автор

I think Linus is right in the sense that C++ includes many of the worst problems that C has. It might also be true that, for a project like the Linux kernel, that a smaller language is a better choice. And I don't think there is a good replacement for that yet (maybe Zig at some point in future?). Rust is a bit more like C++: big and complex.

Personally I prefer programming in C (I don't like lots of abstraction and I hate hate hate hate exceptions), but I wouldn't advocate writing anything new in it.

Google wrote a paper some time back explaining that a few key shortcomings of C++ are not fixable. It's hampered by being two languages in one. I wouldn't write anything new in it unless I had to.

barrykp
Автор

I tried to learn C++ for years, but was never able to.
The tutorials and information I found online were confusing and overwhelming, C++ just seemed like a overly massive and complex language.
I'm not saying it is, or that C++ is bad, just that 16-22yo me couldn't figure it out.
Because of this, I ended up learning C and having fun with that... Although C is painful in many areas, I can comprehend it.
I really wonder if I should make the switch to Rust, or if I'll face the same issues I did with C++.
Any recommendations?

Also, the people in the comments simping for Linus lmao.

xDahl
Автор

Security is more than memory safety, that's just the easiest attack vector right now / what every security researcher is looking for. Doesn't mean Rust programs are secure even IF they are memory safe.

It's hard to write secure C code without fighting your compiler and knowing the ins and outs of it (side channels, undefined behaviour). That does not get easier with an even more complicated language/compiler and possibly runtime. It's possible to write a ISO C compiler that gets within 90% of the performance of GCC/Clang in 10% of the code AND such compilers don't surprise you by assuming your code is free of undefined behavior and "optimize" (i.e. mangle) your program based on that. You take a much larger performance hit by using Go, Java, Lua, etc. than by using a small "boring" C compiler.

With C I debug my programs, not my programming language knowledge.

mettemafiamutter
Автор

Some reasons why we still use C over C++:

* Visualizing the performance impact of a random change in C++ code is much more difficult than a random change in C code ("The compiler will optimize it" is NOT an excuse, too many times, it does not)
* Examples:
* Templates/Virtuals/Exceptions bloat code size/instruction locality, which is especially bad for embedded systems and critical real-time low-level system.
* Exceptions are impossible to interoperate with C code, and extremely difficult to make work in embedded environments (And most C++ code including STL uses exceptions).
* Many C magic are not possible in C++ (i.e. C++ is NOT A strict superset of C, porting is significantly more involved than people will make you believe).

yyny
Автор

> Gets offended by statement that C++ solves _none_ of C's shortcomings.
> Can't even identify C's shortcomings.
> Defends ridiculous footguns in standard C++ libraries.
Subscribed for comic relief. You're like the programmer's version of The Colbert Report.

globalmedicinalmarijuana
Автор

Totally agreed. If C was way better than C++, then people would not learn C++ after C. They would still do their work with C. And for Linus I could say one thing "Make Linux Open!". Yes Linus will understand what does that mean.

gurbanliye
Автор

Dialy reminder that Objective-C++ exists lmao 😜

opiniondiscarded
Автор

Assembly is the best. No syntax and library hell crap.

interrogationwatch
Автор

How come? C++ fixes, for example, the need of using pre-processor macros (which are ugly, very hard to maintain and error prone) with templates. Anyone who try to implement generic data structures in C knows how shit is to do this kind of work.

philippemts
Автор

Linus created git too, so not a one hit wonder by any stretch of the imagination.

fobef