I am sold on the idea of Rust, it's awesome. I've played around with Rust and love it conceptually and philosophically.
When I sit down to actually learn it or start hacking on something, I'm consistently put off and frustrated by the steep learning curve in terms of being able to read and understand Rust programs. The syntax is relatively complex compared to the other languages I know. Everytime so far I've ended up overwhelmed and given up in frustration.
This is just for fun, there isn't a professional driver pushing me every day to learn it.
I'm hoping for a better way than "just push through it over and over until it becomes familiar". Learning Go was a pleasure back in 2012, and I wish learning Rust felt similarly empowering, but sadly it's felt opposite.
What is the most efficient and ideally fun way to gain proficiency in Rust?
Thank you!
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.
The biggest thing I see people go crazy with in Rust is trying to avoid cloning things. I've watched it block people from progressing in the language. Yes, you ultimately don't want to clone everything everywhere, but getting something built in Rust and then iterating backwards is often a better way to learn the language than trying to be "correct" from the start.
Cloning often removes any need to deal with lifetime signatures or what-have-you. If you're bothered by a full clone, grab Rc/Arc and use that trade-off in the beginning - it's not going to kill you. These changes make the syntax of the language fairly comparable to other languages.
tl;dr: .clone() things, measure if it's a problem, and then work backwards to the state you feel that the language/borrow-checker/whatever is pushing you towards.
What language(s) will keep one employed for the next 50 years?