Rust for C++ Developers

Motivation and expectations

Rust for C++ developers is a collection of blog posts aiming to introduce people experienced with C++ to Rust. The posts try to explain some Rust concepts by making parallels with C++ and reviewing sample code.

Before picking up Rust I was writing C++ professionally for 10+ years. The language taught me a lot and I still love it. I will neither troll C++ nor explain how great Rust is. Neither I will explain how pointless Rust is considering that modern C++ exists. Both languages has got benefits and drawbacks and it is up to you to decide which fits better for your job. If I have to compare C++ and Rust in these posts it will be only from technical point of view.

The posts are not a complete Rust tutorial. They are tailored for a people experienced with C++ so if a concept in Rust is the same as the C++ one I'll just mention it and maybe refer to an external resource for more details. If you are not familiar with C++ these posts might still be useful for you but you will miss some context.

If you are looking for a good resource to learn Rust from scratch I can recommend these:

  • The Rust Programming Language aka "The Rust Book". It is available for free on the official Rust website and it is considered the default goto book for people interested in learning Rust.
  • Programming Rust. An O'Reilly book covering some topics in greater detail and making a lot of parallels with C++. I've read the first edition of the book and I really enjoyed it. I consider it optional though since 'The Rust Programming Language' is free.
  • Rust for Rustaceans. This is a great book digging deeper in the language. I suggest to read it when you have gained some experience with Rust.

The posts

Here is the list of my posts:

  1. Quick guide to Rust's syntax for C/C++ developers
  2. Rust syntax continued
  3. Ownership and the borrow checker - WORK IN PROGRESS
  4. Cargo - Rust's build system - WORK IN PROGRESS
  5. Collections - WORK IN PROGRESS

And finally don't just read books and blogs. Read other people's code and more importantly - write code by yourself. There is no substitute for practice in programming.