4 ms·
this is literally the opposite advise that is generally given! Rust isn't considered to be a language that you can simply pick up, code in a style that is idiom
by simon_void 3y ago
this is literally the opposite advise that is generally given! Rust isn't considered to be a language that you can simply pick up, code in a style that is idiomatic in another language, and become Rust-idiomatic over time. (People who attempt this normally give up after trying to implement a linked list. Do not try to implement a linked list (or other self-referencial data types, that's advanced stuff in Rust)!
So first read the book that try something, and now that Rust is hard to get into (apparently hard for C/C++-folk because they think they already know how this kind of programming, and therefore Rust, has to work).
Since it's hard, you know that you're not doing anything wrong, when it feels hard.
There aren't really any shortcuts since Rust is made off of several parts that work closely together, so you kind of need at least have heard about it (so read the book first).
My advice: in the beginning it's ok to use clone() whenever you run into a lifetime issue. Over time while you get better, your usage of clone will decrease naturally.
Check out: Learning Rust the wrong way https://www.youtube.com/watch?v=DL9LANLg5EA https://www.youtube.com/watch?v=DL9LANLg5EA
to see why the hard way is the fast way (at least in Rust).
- leandot 3y agoHe has already said that he read the Rust book, my suggestion is to start applying what he learned, not to read the next book.
- meiraleal 3y ago> this is literally the opposite advise that is generally given! It can still be a good advise tho. I was building a webrtc server in nodejs but decided to change it for Rust to learn. It was quite difficult! But now I'm starting to understand things that I don't understand in Rust and that spiked my curiosity much more than when I tried to study it starting by the theory.