3 ms·
Is C/C++ knowledge important for learning Rust?
by sidcool 8y ago
Is C/C++ knowledge important for learning Rust?
- steveklabnik 8y agoOpinions are split. Many people have learned it without any previous C or C++ knowledge. Some argue that you can't truly appreciate Rust until you've written them. It can be helpful, but it can also be harmful.
- rwnspace 8y agoI am still in my first year of programming and Rust is my first systems language. I don't know C++, just enough for 'gists'. I had already read/skimmed Computer Organisation and Design: RISC-V, and Operating Systems: Three Easy Pieces. I worked through 'The 2018 Rust Book' at a fairly decent clip as a result of that context. I reckon that mostly sidesteps the 'help/hinder' tradeoff, though I'm not humble in saying it took a fair bit of dedication (maybe more than simply learning C++ fundamentals). Edit: actually I'm well into my second year of programming now, time flies...
- Macha 8y agoNot really. It'd help speed up the process for some areas, but it's not that significant as rust has other influences and its own unique areas.
- 6keZbCECT2uB 8y agoI've found that the Rust code that I've written is stylistically more similar to Haskell. However, while references in Rust are a distinct concept from references in C++, they both have a distinction between a pointer to an object and the value of an object.
- pornel 8y agoIt's not. Rust exposes similar lower-level issues that C/C++ also deal with, like memory allocation on stack vs heap, but you'll pick them up while learning Rust one way or another. In some ways C/C++ is a hindrance when learning Rust, because although Rust has many features superficially similar to C/C++'s features, the details are different and programming patterns are different, so you'd need to un-learn some C/C++ habits.