4 ms·
>"C/C++ are in a category of their own." If one wants to know it all then yes. C++ is huge language. In practice except few people nobody really needs to. Subs
by FpUser 4y ago
>"C/C++ are in a category of their own."
If one wants to know it all then yes. C++ is huge language. In practice except few people nobody really needs to. Subset of modern C++ enough to solve many real world tasks is very easy to learn in my opinion.
With Rust one must first train brain to wrap around those ownership rules and this might not be easy.
Fortunately or not I do not know even remotely enough of Rust to do the real comparison of "mental load" but at some point I will.
- imron 4y ago> With Rust one must first train brain to wrap around those ownership rules and this might not be easy. You need to do that in c++ also, otherwise you'll still have the same problem - only randomly at runtime instead of at compile time.
- charcircuit 4y ago>With Rust one must first train brain to wrap around those ownership rules and this might not be easy. C++ users already understand ownership because C++ has ownership too. With C++ you have to me extra careful because the compiler won't save you from making mistakes like Rust will.
- FpUser 4y agoI meant ownership as implemented in Rust. I am perfectly fine with ownership models of C++ and some other languages.
- charcircuit 4y ago>I meant ownership as implemented in Rust. It's the same thing in Rust and C++. There is no difference conceptually.
- hn_go_brrrrr 4y agoDisagree, unless we're including Rust's unsafe. Excluding that, you need to understand what the Rust compiler is able to prove is safe. In C++, you "just" need to prove to yourself that it's safe. It's a very different experience writing code.
- Yoric 4y agoSo perhaps "ownership rules" is the wrong vocable for this. Maybe "ownership proofs"?
- charcircuit 4y agoIn Rust you need to understand borrowing to write programs that compile. In C++ you need to understand borrowing to avoid writing programs that use undefined behaviour. Yes, it's a different experience, but both have the same concept of borrowing that you must understand.