4 ms·
Probably an obvious question, but have you read the book? Even if you feel your experience with other languages should be enough to let you skip “beginner” cont
by mplanchard 5y ago
Probably an obvious question, but have you read the book? Even if you feel your experience with other languages should be enough to let you skip “beginner” content, I cannot recommend the book enough. Going through every chapter and doing the exercises should get you in a place where you can write rust relatively comfortably. From there I think Rust in Action is another good source of introductory material.
I also don’t know what you’re using for your dev environment, but whatever it is, make sure you’re using the rust-analyzer language server. The excellent and immediate inline warnings and errors are immensely helpful, even now with several years of rust experience under my belt.
I think it’s also really helpful to do a couple of small projects with limited scope, e.g. a single-threaded, literal match grep CLI, or `du` clone or whatever.
As Klonoar pointed out, also don’t beat yourself up over writing “good” rust, at least not initially. Don’t worry about cloning and unwrapping, and throw stuff behind an Arc and/or Mutex whenever shared access or mutation gets hairy. Taking that route, Rust isn’t more difficult to write than any of the other languages you know, and it’s fine while you build familiarity.
Also don’t hesitate to reach out on Rust’s zulip or discord, or the unofficial community on reddit. People tend to be very helpful.
- metadat 5y agoWhat is "the book"?
- CUViper 5y agohttps://doc.rust-lang.org/book/ https://doc.rust-lang.org/book/
- mplanchard 5y agoThanks for linking! I should have been more specific.
- jjice 5y agoHighly recommend. It's a great overview of Rust's ownership model and how to use things properly like enums and traits. Steve Klabnik is one of the authors if I recall correctly and he's been such a great resource for learning Rust. He lurks on HN as well and whenever you see a well written Rust comment, it's probably him.