Hacker News new | ask | show | jobs
by davidhyde 1638 days ago
I’d recommend working through rustlings rather than watching videos for basic rust understanding: https://github.com/rust-lang/rustlings. It is essentially a set of quick exercises to get you familiar with the language and how to fix common build errors.

For advanced Rust “Jon Gjengset” has posted a number of long-form videos on YouTube that are very good. Search for it.

For code examples, find a crate in an area that you are interested in and clone the repo. There are so many to choose from that it would be unfair to single anything out. Variation is good, not bad. If you see lots of generics and macros then skip it for early learning purposes.

Instead of writing something from scratch I’d recommend rewriting something you are familiar with in but in Rust. For example, if you did advent of code (if that is your thing) in python then write it in Rust and find a repo of someone who solved the same problems in Rust.

The Rust book is excellent. https://doc.rust-lang.org/stable/book/

2 comments

> For advanced Rust “Jon Gjengset” has posted a number of long-form videos on YouTube that are very good. Search for it.

Jon has also released a book called "Rust for Rustaceans", aimed at intermediate ("experienced") developers, to provide them with both idiomatic and ergonomic rust solutions, as well as deeper understanding of the more advanced concerns of the language (macros, async, unsafe, ...).

Absolutely no... The book is not user friendly for new learners. It's good, but not for beginners. BTW It's 600 pages!
Strongly disagree. User friendly doesn't mean "short", it means "accessible for newcomers" in this context. And the rust book very much is that: it starts out extremely basic/simple and builds from there. Anecdotally and for many others it's been the best way to develop a solid understanding of the language.

Rust is somewhat "shortcut resistant" for new learners: you can pick it up by just starting coding after reading a few blog-post-length tutorials and backfilling understanding, the way many people do with other languages, but this typically takes much longer and incurs more frustration with Rust than, say, Python. That's because Rust takes longer to understand than most languages (I say this as someone who enjoys the language and expects it to become quite widely used, not as a criticism). Hence the book: it's long, but quite friendly. It's just not what you'd expect if you compare it to other learn-a-language-in-x-hours experiences.

I disagree - I found the book to be very valuable when learning Rust. I agree it would not be good if Rust is your first programming language. But I think many beginners to Rust are people who are already experienced programmers and basically just want to know some mental models for how Rust's memory model works, some useful idioms and patters, "how to do X in Rust", and how to get started.