As people know C++ has been around for years, decades even, however despite the language being as mature as it is, the language is still getting new features, which depending on how you look at it, can either be a good or bad thing. In this article/post I'm going to lay out the foundation of why I personally am moving to Rust.

Library / Package Management

Let's be honest here, C++ despite being as mature as it is, has horrific package management, having to manually download each library your package needs, adding it to your project via MAKE or a MAKEFILE generator such as CMake, or Premake, while generators do make your life easier in a lot of cases, it's still quite a hassle.

In rust on the other hand, it's as simple as either dropping a line into your Cargo.toml file or by executing cargo add <library>, and this compared to C++ is a honest luxury when it comes to a casual development workflow, especially for those on a time crunch.

Thread Safety

One thing rust does amazingly well, is enforce thread safety, while similar to C++ in the fact it does not use any type of garbage collector, it does enforce you to use thread and data safety, so that data shared across threads among other things is done in such a way data corruption and race conditions don't happen, at least not as often as they do in the C family of languages.

Error Management

This section may or may not be a somewhat controversial topic, as some people love it, and some people hate it, personally I love how Rust manages it's error handling. While it can become somewhere tiring to write out error enums for a lot of things, it does force you to know what type of errors are possible in your code. If you write an error enum and it's missing a possible error type that a function could throw, it's going to yell at you saying "hey, this can also throw this error!" which when it comes to error management, is a honestly nice feature, whereas in C++, errors can just be.. thrown without having to specify what exactly types of errors, it should be able to.

Syntax

Alright, I'll admit in some cases Rust's syntax is quite odd, Ok(()) being an example of that weird syntax. But in a general sense, Rust's syntax is in my opinion a lot more modern than any of the C family of languages (except for maybe C#, but it still has the general style that the rest of the C family does). However despite the few things I find odd about the language's syntax, it does have a lot of thing I honestly love, such as return types being after the function declartion instead of before, as well as expressions such as if let. It's also quite cleaner in my opinion than C has ever looked, as an example:

fn main() {
    println!("Hello World");
}

In my honest opinion looks a lot cleaner than how you would do this normally in C++:

int main()
{
    std::cout << "Hello World" << std::endl;
}

Conclusion

There's many, many more reasons I have decided to switch from using C++ to Rust almost if not exclusively, but that is a few reasons or a general overview of why I have, Rust is a lot different than the C family of languages in many ways, and as such it takes a while to get used to, especially as it enforces a lot of things at compile time (including thread safety). In the end, it's a matter of which one best suits the project at hand, but in this case, with both languages being somewhat system languages, I think Rust will certainly take the cake in most of my projects that require one.