Rust vs C++: Utility or usability?

Rust is a new contender against C++, making an argument stating Rust is safer, more usable and ultimately better than C++. Is this true?

June Redwood
3 min readOct 8, 2021
Photo by Arnold Francisca on Unsplash

Why do we need a replacement for C++ anyway?

Well, C++ has a lot of problems. It’s quite annoying to use if you’re not experienced in C++, memory management and terminal setup. C++ is used in programs that need to be fast, reactive and responsive, like a programming language or even a traffic light.

C++ errors are also a massive pain in the butt. You get barely any errors while writing your program, and even if you don’t get errors at compile time, it’s likely your program won’t work as planned.

Rust wanted to be a massive contender to C++, a fix to the pain that developers have had to use since 1985. Rust is a good language, but should you switch if you’re a C++ developer?

C++

C++ is a really old language that is arguably more versatile and widely used than Rust. Like I said earlier, C++ is used as a real time language for real-time things. Even though it’s annoying, C++ is reliable. If your code works when you test it, C++ won’t break. C++ is also a Object Oriented language, as well as being compiled.

C++ also has a massive job market. If you search C++ jobs, you won’t need to wait before you have a job. Rust is decent too, but it’s newer than C++ meaning that the job market is lighter.

Pros

Reliability

More widely-used, higher job market

Lots of utility — you’ll always find the right class or component for what you need to do

Cons

Errors are not very easy to read and hard to deal with without help

Definitely not beginner friendly

Docs don’t really exist, but the standard library definition is extremely hard to read

Rust

Rust is easier to use than C++, but lacks some of the pros I just mentioned. Rust can sometimes be unpredictable — what form of rust (“unsafe” or “safe”) will your program use? Will cargo, it’s built in package manager, even work and be setup properly? Rust was introduced quite recently, in July 2010.

Rust does make things easier though. Memory management sometimes doesn't need to be touched, and it also has amazing docs. Colloquially named “the book”, the documentation for Rust is perfect. In a logical order, the book goes from the very basic to the advanced.

Job market is small, not really much else to say about it.

Pros

Easier to use and more readable code

Good docs

Depending on how you use it, safety from the horrid mess of memory management

Cons

Sometimes slightly less versatile than C++, sometimes more a contender than a replacement

Smaller job market than C++

Potential unreliability

Conclusion

It really depends what you’re using it for, as always. Personally, I say that if you are new to programming, but want a language with lots of future potential, go with Rust.

If you have experience with OOPs (Object Oriented Programming Languages) or understand memory management and are willing to go through the most painful installation process ever, definitely use C++. It’ll be annoying at the start, but good in the long run!

If you enjoyed this, please clap for this post or follow me! I put lots of work into this blog!

--

--

June Redwood

Hiya! I’m June. Front-end Enthusiast | React learner | School student