News for hackers. Stuff that matters.
Re:Learning Rust by mswift42 on Thursday March 15, 2018 @03:10PM (#16595680)
No, I mean that every chapter ends with exercises testing your knowledge about the chapter's contents.

This is not specific to this github site. I've recently read the O'reilly Programming Rust Book, not a single exercise in it, and the official The Rust Programming Language Book also doesn't have any.

Re:Learning Rust by shepmaster on Thursday March 15, 2018 @03:30PM (#16595853)
> and the official The Rust Programming Language Book also doesn't have any

Could you expand on bit on what you see as the difference between an "exercise" and the "projects" that the book includes?

- Guessing game: https://doc.rust-lang.org/stable/book/second-edition/ch02-00...

- I/O: https://doc.rust-lang.org/stable/book/second-edition/ch12-00...

- Web server: https://doc.rust-lang.org/stable/book/second-edition/ch20-00...

There's also some exercises scattered at the end of various chapters, but not with the header "exercise"

- Control flow: https://doc.rust-lang.org/stable/book/second-edition/ch03-05...

- Collections: https://doc.rust-lang.org/stable/book/second-edition/ch08-03...

Sometimes they are even inlined with the text:

> Try modifying Cacher to hold a hash map rather than a single value.

> try introducing more generic parameters to increase the flexibility of the Cacher functionality.

- https://doc.rust-lang.org/stable/book/second-edition/ch13-01...

Re:Learning Rust by chc on Thursday March 15, 2018 @05:27PM (#16596665)
I think this is the difference between the "projects" all through the book and the "exercises" the earlier commenter is looking for: The projects in the Rust book are just a construct to give the example code context. It's not you working through the problem — it's Steve Klabnik, with you just following along. In fact, a reader who is actually learning Rust can't do the projects, because they don't have the requisite knowledge before reading the chapter that the project appears in. "Exercises" are more of a challenge: "Now that you know this stuff, try to accomplish X task on your own." By accomplishing the task, you both prove to yourself that you understood the material and help solidify it in your mind. Retyping code doesn't give the same benefits or experience.

The second list of examples you gave does seem like the right sort of thing. I'm guessing the earlier commenter overlooked those because they're listed under the header "Summary," which kind of screams "skip me."

Re:Learning Rust by steveklabnik on Thursday March 15, 2018 @06:17PM (#16596970)
> In fact, a reader who is actually learning Rust can't do the projects, because they don't have the requisite knowledge before reading the chapter that the project appears in.

Hm, we certainly expect that this is possible. If this is too hard, we need some tuning!

Re:Learning Rust by chc on Thursday March 15, 2018 @06:54PM (#16597190)
I think maybe I was a little bit imprecise. It's not that the projects are too hard, but that the way the book is structured doesn't give you what you need to complete the project before giving you the project itself. They're a "follow along" thing, not a "here, now you're 100% ready for this" thing. The projects tend to be designed to illustrate the concepts introduced in the chapter, so a reader can't do the project before they've read the chapter, because they don't know the things that the project is meant to teach. And after they've finished the chapter, they've already finished the project just by following along — but they haven't actually demonstrated any mastery of the subject in doing so.

For example, it's not like somebody's going to start TRPL, see "Let's make a guessing game," stop there and successfully make a guessing game — they don't know any Rust at that point! Similarly, IIRC we're not introduced to most of the IO functionality before the IO project, and so on.

Re:Learning Rust by steveklabnik on Friday March 16, 2018 @02:57AM (#16599075)
Thanks for clarifying. :)

Jake lists both kinds above; it's true that the project chapters are "follow along", but there are also suggestions for doing some extra stuff on your own.

Regardless, I think your overall point is correct: tons of projects is certainly not how we've structured the book. It is a thing some people want and would find useful. We'll see in the future.

Re:Learning Rust by YuukiRey on Friday March 16, 2018 @04:06AM (#16599281)
Personally, the Rust Book (2nd edition) seems like good teaching material (from the perspective of a junior self-taught JS dev). What would make it even better is adding a few questions at the end of each chapter, much like the homework in https://www.seas.upenn.edu/~cis194/spring13/lectures.html. These don't have to be large projects, but they shouldn't be a simple rehash of the prior code blocks either. Ideally they pose a challenge that, when solved in a "typical beginner way" (whatever that is), cause the reader to stumble over some common gotchas.

The first few chapters actually mention and explain some of those gotchas (like ownership in regards to returning from functions or accepting a reference). The difficulty probably lies in not outright explaining everything, but not making the reader feel completely lost at the same time.

Then again, questions can always be added later on and if the basic reading material is good (which it is!), it's only going to make an already good source even better. I guess that's meant to say thanks for the Rust book.

Re:Learning Rust by steveklabnik on Friday March 16, 2018 @05:20AM (#16599485)
Makes total sense. Thank you! I’ll give this some thought.