I’ve long been of the opinion that Rust is better than C++. In Rust: A New Attempt at C++‘s Main Goal, I explicitly frame Rust as a new C++. Basically, Rust is what C++ would be if it were designed with what we know now, released from backwards-compatibility with C and (more importantly) backwards-compatibility with itself.
Here are some articles I’ve written about some of the technical specifics:
- C++ Move Semantics Considered Harmful (Rust is better), my most popular article on the topic and for a long time, a discussion of a structurally important feature that C++ gets wrong and can’t fix.
- RAII: Compile-Time Memory Management in C++ and Rust, explains how Rust lifetimes and the borrow checker complete C++‘s ownership-based memory management story and make it compatible with memory safety.
- Sayonara, C++, and hello to Rust!, my excited post from when I first fell in love with Rust.
- A Rust Gem: The Rust Map API, a discussion of a minor feature where C++ just doesn’t do it (because they don’t have a borrow checker).
I’ve also just directly criticized C++:
- C++ Papercuts, which got featured in a YouTube video by ThePrimagen and blew up tremendously.
- My Dream C++ Additions, which tried to be a little more positive.
I also think that some of the Rust vs. C++ debate has been unfairly framed, specifically the debate about memory safety:
- In Being Fair about Memory Safety and Performance, I try to explain that
the point of Rust isn’t to never ever use
unsafe, and it’s still a better and safer programming language than C++ if you end up usingunsafefor performance sometimes. - Can C++ fix its biggest problem?, was sort of a throw-away article maintaining that theme, which I stand by even if it’s kind of basic.
In engaging directly with the debate, I also had some pure rebuttals:
- My Reaction to Dr. Stroustrup’s Recent Memory Safety Comments, I weighed in on the public disagreement that Bjarne Stroustrup, inventor of C++, had with the NSA
- I also weigh in on terminology nits In Defense of ‘C/C++’.
- In There is No One True Best Programming Language (but some are still better than others), I addressed the surprisingly common argument I heard that all programming languages have their strengths, and so Rust couldn’t possibly just be better than C++.