> He’s aware of other languages, as he reveals in his answer to a later question. (“I think C++ can do anything Rust can do, and I would like it to be much simpler to use.”) And towards the end, he couldn’t resist noting that longevity has its advantages. “It’s highly humorous when some of the Rust people come up and accuse me of having stolen some of their ideas without acknowledging — when some of the things I did I actually did almost 40 years ago.”<p>Does anyone know what these accusations were?
Given that C++ has been around for so long, It's incredulous to think that anyone from the Rust community can put forth such a claim.
> Once you get users, you have responsibilities, and one of the responsibilities is not to break their code.<p>That is both a good and bad thing.<p>Within both C++ and JavaScript there is a very elegant programming language with powerful semantics.<p>However, there are also a lot of bad solutions and dangerous hacks accumulated. And most of us programmers don't know how or don't have the self discipline to separate the good parts from the bad parts. And sometimes even with the knowledge and self discipline you can't avoid them (e.g: when using someone else's libraries).<p>In some languages (e.g: Lua, Python) the designers are ready to break backwards compatibility. C++ chose not too.
In Rust, ownership is a compile-time issue. This puts constraints on how you can use references, how ownership is passed around and so on. This programming model has a cost to the user and is probably inherently slower to compile just because the compiler has to do more.<p>But at runtime it's essentially free.<p>C++ on the other hand added a set of primitives starting in C++11 to be explicit about ownership through std::unique_ptr and such. These have a runtime cost and ultimately mean getting locks. I've seen estimates of this cost in the single digit microseconds. Not exactly super-expensive but not free either.<p>There are simply some assumptions Rust can make that C++ can't because certain things aren't possible in Rust.<p>Another example: Rust doesn't have exceptions. Over the years I personally have some to believe that exceptions are largely a false economy (particularly the failed experiment that is/was checked exceptions in Java).<p>Instead Rust has match expressions and enumerated types (with state!) that force you to deal with return types. This BTW is very much what Google C++ looks like. It's even debated if you can ever write truly exception-safe C++ code.<p>This is another problem Rust doesn't have by virtue of not having the feature.<p>Are you starting to see the pattern? C++ has everything in it. That comes at a cost and there's no getting around that.
A bit off topic but I didn’t want to make a separate post for this. I want to brush back up on C++ and learn all the modern features. It’s been over 10 years since I’ve touched any C++ and looking for a good book recommendation for someone that’s familiar with many other programming languages and has programmed quite a bit of c/c++ in the past.
> We have a model for better concurrency coming up. Almost certainly it will be in [C++ version] 23. It exists and it’s used. It’s backed by people like Facebook and NVIDIA and Intel… So that’s where we’ll get a better concurrency, better use of hardware… Beyond that, I am looking at functional-style pattern matching...<p>Better concurrency and functional-style pattern matching? Yes please.
Also, don't forget that C++ has _age_ behind it. Lots of places are still on arm-gcc-5 because heaven forbid you try to get a new compiler digesting an old code base, then get all stakeholders and customers onboard.<p>I dream of C++20. But my nightmares are all pre-C++14.
Does the case for C++ in 2020 still exist? Rust and Go are much simpler to learn, can do everything that C++ can and have sane, simple and clean build systems/package managers, not to mention async/await concurrency in the former and channels in the latter.
Does anyone have an example of a large codebase that actually uses modern C++ to its fullest?<p>One of the larges codebases I know about, Chromium, seems to use only a minimum of C++ features. It's mostly limited to 1980s "C with objects" paradigm, plus smart pointers.
“I don’t believe that there is or could be a perfect programming language — at least not in the time scale we’re talking about, a few decades or a hundred years. Maybe in a hundred years, but not in my lifetime.”<p>Absolutely agree and wish more people did.
He talks about fixing Exceptions in c++, what is wrong with exceptions in c++ and how would you fix those? Go does not have exceptions, but I don't think Go's method of checking for error on every step and doing early returns is more elegant.
> "Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know."<p>While likely accurate, this thinking is likely not conducive to UX innovation.
> “I think C++ can do anything Rust can do, and I would like it to be much simpler to use.”<p>I think Bjarne isn't getting the <i>issue</i> with C++. Yes they're Turing-complete, yes they can both solve the same set of problems.<p>The issue is that C++ can do <i>everything</i> that <i>every</i> other language can do, which means it's not a language, it's a universe of features. You make the language by picking which features, patterns, philosophies, architectures you want. It's like if a language dictionary included English, simplified Chinese and Korean.<p>The problem IMO is there's no such thing as C++. Each company, each team, each person has their own. Many of these C++'s are incompatible with each other.<p>Worse, many of the new language features can't be properly implemented because they would break someone else's C++.<p>The problem is it tries to be everything to everyone, and that makes it (and futures standardization efforts) full-on Quixotic efforts. I mean, by all means, have at those windmills tho.<p>Bjarne points out how much he hates templates, and has some great new ideas for generic programming. Lovely, but he's never gonna get rid of templates, so now we have 2 problems.
I’d love to know how he’d like for C++ to support distributed systems in broad strokes.<p>The first thing that comes to mind is things like gRPC or the actor model but I can’t imagine he has either of those in mind.
> I think C++ can do anything Rust can do, and I would like it to be much simpler to use<p>You're going to need to break c++ then. It is so much harder to use than Rust today, I have no idea why anyone would choose c++. The libraries argument is mute because its such a pain to use external libraries.