3 ms·
Yeah, people with C++ experience have an advantage when learning Rust, since they're used to these concepts, and the Rust compiler enforces things they already
by cesarb 9y ago
Yeah, people with C++ experience have an advantage when learning Rust, since they're used to these concepts, and the Rust compiler enforces things they already know to be careful with (like not mutating a container while there's a live iterator to it). On the other hand, Rust lacks some things C++ has like being generic over values instead of just over types, so for instance implementing a trait for every fixed-size array of a type is currently AFAIK not possible (the usual solution is to use a macro to manually implement the trait for every size up to 32).
- shmerl 9y agoSure, there are differences as well, and there is no point in always mimicking C++ approaches in Rust 1:1. But I think overall, coming from C++ to Rust should be one of the easiest transitions.
- TillE 9y agoAs someone who's extremely comfortable with C++, I've tried Rust multiple times but keep bouncing off. Ultimately my problem is just that it doesn't have enough exciting features to lure me away, especially with C++ improving every few years. Compiler-enforced safety and a built-in package manager are really nice, but it doesn't quite make up for the loss of a lot of handy C++ features.
- steveklabnik 9y agoWhich features do you miss the most?