5 ms·
Pleasantly surprised by Linus response. IIRC his attitude to C++ was that it should be refused if only to keep C++ programmers out.
by pepijndevos 6y ago
Pleasantly surprised by Linus response. IIRC his attitude to C++ was that it should be refused if only to keep C++ programmers out.
- buster 6y agoYes, very much so. Not even only in the context of Rust but the insight, to fail fast, integrate early and do work in the open, instead of some hidden work, failing after a long time, when revealed.
- kevingadd 6y agoPerhaps the possibility of rust improving kernel security/robustness makes the idea of rust integration seem like it carries its own weight, where C++ has more downsides (perceived or real) and fewer upsides. Rust's history/origins - loosely, being designed to allow replacing Mozilla's C/C++ with safer Rust that performs well - feel like a good fit for kernel drivers even if the core kernel bits will always be C.
- for_xyz 6y agoHis attitude towards C++ also changed when using it for his side project [1]. Initially he started with C and GTK+ and later migrated to C++ and QT Framework. [1] https://subsurface-divelog.org/ https://subsurface-divelog.org/
- mrmonkeyman 6y agoNews at eleven. Grumpy autistic coder changes opinion only after he experiences it himself instead of listening to other people's arguments. Wasting untold man-years in the process.
- globular-toast 6y agoDid he have an "attitude" about C++ in general? I thought he only commented on it with respect to operating system development. He did make much more general statements about Java, though.
- agumonkey 6y agoDid he talk about his thoughts precisely ?
- for_xyz 6y agoI think I watched an interview with him where he talked about Subsurface project. In that interview he said that C++ is not all that bad but he still prefers C because he's so used to it and will continue write C code forever. I don't remember title of the video though.
- josefx 6y agoI think that was after others took over the UI development. The back end of that program also was still C as far as I remember from their presentation and the move was mostly motivated by the GTK community, the documentation and different priorities on cross platform support.
- for_xyz 6y agoYes, you're correct. Linus still works on C backend of the application and sometimes has to connect his parts with C++ code.
- stjohnswarts 6y agoI love how the bugtracker on that is "check out our mailing list" :D
- xvilka 6y agoRust is well designed modern and concise language with sound type system, while C++ isn't. The difference is huge and obvious.
- hellofunk 6y agoExcept that one of Linus' most vocal offenses on C++ was due to operator overloading and how basic, seemingly native things like + can actually do a lot of hidden stuff unknown to the programmer. He must have softened on this since Rust offers the same facilities for operator overloading. https://doc.rust-lang.org/stable/rust-by-example/trait/ops.html https://doc.rust-lang.org/stable/rust-by-example/trait/ops.h...
- cletus 6y agoLinus’s point was also that C++ makes extensive use of function/method name overloading (is polymorphism) and this can make code hard to read. Not only is this not possible in C but the feature tends to be overused in C++.
- zozbot234 6y agoRust generally uses function/method polymorphism based on traits (aka type classes), that's far less prone to overuse and abuse than overloading in C++.
- hellofunk 6y agoIs this form of polymorphism done at runtime and thus incurs a similar overhead to the C++ virtual?
- steveklabnik 6y agoThere are two ways of doing it. The way most people use most of the time does not, it's statically dispatched. The other way is dynamically dispatched, though there are some differences from the way that C++ virtual works. They should be roughly the same in that case, though.