u/MightyChubzin r/rust • Recommends
On “Coworker: "Rust doesn't offer anything C++ doesn't already have"”
Built-in memory safety. Ownership model and borrow checker ensures that your values aren't being thrown around all over the place.
Example: https://pastebin.com/w1dtmxbc
This program won't compile becuase you are using an immutable variable while there's a mutable variable in the same scope. This is something the C++ compiler doesn't check for, but this feature ensures safety. What if you modify 'y' and then read from 'z' expecting the previous value?
Something else that is also amazing in Rust is the multithreading. It is much easier to keep an eye on who's accessing what, instead of using the 'mutex' keyword in C++.
There is a full talk about this here: link to this video