3 ms·
It's difficult to answer this right now because the overwhelming majority of people who use Rust now have at least some background in C or C++. If you're comin
by amalcon 4y ago
It's difficult to answer this right now because the overwhelming majority of people who use Rust now have at least some background in C or C++.
If you're coming from Java, the most difficult thing you'll need to learn is memory management, as all of those languages do that for you. The other difficult thing is threading, but that's 1) unnecessary and 2) not actually that different from Java.
Rust forces you (unsafe aside) to do memory management in one specific way, and verifies it in the compiler. C and C++ let you do whatever you want, though C++ encourages (without requiring) a Rust-like approach.
I think Rust will probably be better if you want to have a constrained environment that tries to prevent mistakes. C will be better if you want to explore on your own, learn from the mistakes, and thus understand why Rust wants you to do particular things. C++ frankly doesn't have a whole lot to recommend it unless you are working with a C++ codebase, already know C, or really need one of its features.
- cbm-vic-20 4y ago> If you're coming from Java, the most difficult thing you'll need to learn is memory management, I'm coming from a largely Java background (though I program a lot of C and assembly as a hobby), and this statement is very true. Getting used to the borrow checker and reference lifetimes has been the largest obstacle so far. But once that is understood, the rest of Rust is basically learning the idioms and ecosystem. I will likely change how I write C based on my experience with Rust's memory ownership model..