Found in 14 comments on Hacker News
It took me a while to get comfortable with Rust.

I tried reading "The Rust Programming Language" book, but had difficulty with it.

The book that worked for me was "Programming Rust": https://www.oreilly.com/library/view/programming-rust-2nd/97...

The way that it explained things made more sense to me and helped me to understand many of the design decisions behind why Rust works the way that it does.

But reading books only takes you so far. You need to write code and read code to understand through experience. I took a C program that I wrote at my job and rewrote it in Rust. It was a revelation: in writing the Rust version I discovered many bugs that were not obvious in the C version simply because of Rust's detailed approach to error handling. The Rust version was much easier to understand and maintain and is the one we use now.

I was originally very skeptical of Rust, but if you write software in C or C++ and then write comparable software in Rust, it makes you want to use Rust every time instead. Rust code helps prevent errors of all types that C and C++ allow. Rust tooling and the ecosystem of crates are so much easier to use.

Here is a quote from "Programming Rust" that I found motivating:

  The Rust language makes you a simple promise: if your program passes the compiler’s checks, it is free of undefined behavior. Dangling pointers, double-frees, and null pointer dereferences are all caught at compile time. Array references are secured with a mix of compile-time and run-time checks, so there are no buffer overruns: the Rust equivalent of our unfortunate C program exits safely with an error message.    Further, Rust aims to be both safe and pleasant to use. In order to make stronger guarantees about your program’s behavior, Rust imposes more restrictions on your code than C and C++ do, and these restrictions take practice and experience to get used to. But the language overall is flexible and expressive. This is attested to by the breadth of code written in Rust and the range of application areas to which it is being applied.    In our experience, being able to trust the language to catch more mistakes encourages us to try more ambitious projects. Modifying large, complex programs is less risky when you know that issues of memory management and pointer validity are taken care of. And debugging is much simpler when the potential consequences of a bug don’t include corrupting unrelated parts of your program.    Of course, there are still plenty of bugs that Rust cannot detect. But in practice, taking undefined behavior off the table substantially changes the character of development for the better.

roland35 · 2023-11-04 · Original thread
I found that the oriely book "Programming in Rust" to be very thorough and helpful for me. It helped me really understand the concepts of Rust. Although the free rust documentation is fantastic too!

https://www.oreilly.com/library/view/programming-rust-2nd/97...

neilv · 2023-10-19 · Original thread
For example:

https://www.ebooks.com/en-us/book/210313783/programming-rust...

Bad news is that the O'Reilly site's page for the book is now (as of around start of 2023) sending people to a subscription, though:

https://www.oreilly.com/library/view/programming-rust-2nd/97...

They used to send people to Amazon or Ebooks.com first:

https://web.archive.org/web/20221128145404/https://www.oreil...

Longer term, I don't know whether they intend to keep Ebooks.com and Amazon as options at all, for those who can find the options.

japanuspus · 2022-11-13 · Original thread
My favorite as an old-timer who is comfortable in most things from assembler to Mathematica has been "Programming Rust" from O'Reilly [0]

The book does a really good job at explaining the thinking behind the abstractions available in the standard library. To me, this was the book that made everything click, so that I did not feel I was fighting against the language.

[0]: https://www.oreilly.com/library/view/programming-rust-2nd/97...

tmpz22 · 2022-10-05 · Original thread
Ditto - I have both sitting beside me as I learn Rust and they are excellant. Short review of the former:

https://www.oreilly.com/library/view/programming-rust-2nd/97...

Its a very comprehensive book but takes some dedicated effort to get through. It goes through most (all?) important concepts from barrowing to iterator traits to some async. Give yourself a fair amount of time to read this and find small projects to do along the way to reinforce your knowledge.

nu11ptr · 2022-10-05 · Original thread
I like "the book", but I felt more prepared for the real world after reading the O'reilly book, 2nd edition. That was sufficient for me to write any code I needed. If you want a deeper understanding, "Rust for Rustaceans" is a great book (disclaimer: I only read about half of it - too busy coding :-)

First: https://www.oreilly.com/library/view/programming-rust-2nd/97...

If you want to go deeper after that: https://nostarch.com/rust-rustaceans

atoav · 2022-09-21 · Original thread
A few things. The hardest thing about Rust is to forget many of tthe paradigms or aesthetical ideas other languages hammered into your brain. Programming Rust like you would program Python, Javascript or C++ is going to give you a hard time, but each time in a different way. If you program Rust in the Rust way, suddenly things become easy.

That means what the best way to start is depends on your background. In my eyes you can do nothing wrong with going through the rust book you already mentioned. Having read 4 different Rust books I have to say this introduction in combination with "Programming Rust" by Jim Blandy, Jason Orendorff, Leonora F. S. Tindall is probably the best way to get started. https://www.oreilly.com/library/view/programming-rust-2nd/97...

dcminter · 2022-07-15 · Original thread
I liked that fasterthanlime article a lot too. The main thing it gave me was enough context to get enthusiastic enough about the language to sit down and read through the O'Reilly book¹ (which I thought was excellent).

I'm still very much a Rust beginner, but I've managed to build a couple of useful tiny projects and to hack a feature I wanted into someone else's big 'ol codebase!

¹https://www.oreilly.com/library/view/programming-rust-2nd/97...

lr1970 · 2022-07-12 · Original thread
I found that the following book is much better suited for programmers with C/C++ experience:

"Programming Rust, 2-nd edition" by Jim Blandy, Jason Orendorff, Leonora F. S. Tindall [1]

[1] https://www.oreilly.com/library/view/programming-rust-2nd/97...

vincenv · 2022-02-25 · Original thread
Another book I found very helpful is Programming Rust [1], it expands on many concepts in the Rust book, the chapters on closures, iterators, collections, concurrency and async have very good explanations on how things work.

[1]: https://www.oreilly.com/library/view/programming-rust-2nd/97...

Scandiravian · 2021-12-29 · Original thread
I really liked Programming Rust (got the 2nd edition). It's been a few months since I read it, so be warned, that I might misremember some parts of it

https://www.oreilly.com/library/view/programming-rust-2nd/97...

The book gives good visual explanations for how each of the code examples and it spends a good amount of time showing the relationship between the code examples and the borrow checker, OS, etc.

As most language books it spends a lot of time going through all the types, which I've always found incredibly boring - the same thing is the case with this book.

I'd recommend reading about strings and slices before moving on to the examples, but spread out the rest of those chapters in between the more interesting ones

dnsmichi · 2021-09-12 · Original thread
Last year, we started with the official docs tutorial at https://doc.rust-lang.org/rust-by-example/hello.html

The recording and more findings is at https://everyonecancontribute.com/post/2020-10-07-cafe-3-git... The session took longer, because we failed to understand the principle of modules at first. We solved it after a while.

A more advanced attempt included Rocket.rs and Prometheus metrics instrumentation: https://everyonecancontribute.com/post/2021-06-30-cafe-36-ru...

For learning Rust (and later teaching), I got 2 books:

- Programming Rust: Fast, Safe Systems https://www.oreilly.com/library/view/programming-rust-2nd/97...

- Hands-on Rust: Effective Learning through 2D Game Development and Play https://pragprog.com/titles/hwrust/hands-on-rust/

I love gamification when learning things, and game development is something I always wanted to learn.

For a learning dev environment, I recommend Gitpod in your browser. Cargo and rustc come pre-installed in the default workspace image. A short example is in this blog post: https://about.gitlab.com/blog/2021/07/19/teams-gitpod-integr... (search for "Learn new programming languages: Rust")

More learning resources are at https://www.rust-lang.org/learn

da39a3ee · 2021-05-15 · Original thread
> Where do I find the explanation of why Rust is less awful than C++ written by someone who has written a lot of C++ out of necessity,

The O’Reilly book by Jim Blandy and Jason Orendorff. It is a really fantastic book on a programming language, the best I’ve ever read. The new edition is due this year it seems.

https://www.oreilly.com/library/view/programming-rust-2nd/97...

K0nserv · 2020-09-19 · Original thread
1. Read the Rust book[0] front to back. Yes seriously, the whole thing. Rust is different enough from other languages that it makes sense to do this.

2. Write 1 or more serious rust projects of your own choosing. Aim for projects that’ll be thousands of lines of code.

3. Read “Programming Rust”[1]

4. Write more projects

This is what I did anyway.

The Rust discord has a beginners channel which is invaluable for asking questions when you get stuck.

0: https://doc.rust-lang.org/book/

1: https://www.oreilly.com/library/view/programming-rust-2nd/97...