-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miscellaneous v2 improvements #1
Miscellaneous v2 improvements #1
Conversation
Since this exercise is specifically about traits, the students should have to write the trait impls themselves.
Make the starting code for the counter exercise non-generic so that students have to write the generic paramets and trait bounds themselves.
Remove all of the exercise functions except `visit_doctor`. The other functions were entirely boilerplate, and aren't appropriate at this point in the course. I think it's better to focus on `visit_doctor` which is the only interesting and relevant part of the exercise.
We don't really need to explain deriving as early as we do. It only comes up in exercises and students don't need to know what it means in order to complete the exercise. So it's probably better to cover deriving as part of the traits section.
The original version was unnecessarily contrived, which made it harder to compare with the simplified version that uses let-else. I've changed the code example to better align with the cleaned up version in order to make things clearer for students.
Rework the Luhn algorithm exercise to give students a buggy implementation of the algorithm and ask them to write tests to find and fix the bugs. This makes the exercise more appropriate for the testing section.
Also it's very funny to me that I'm making a PR from the main repo onto your fork in order to add commits to a PR to the main repo. Technology is fun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - thank you!!!
The initial version of `Counter` is hard coded to only work for `u32` values. | ||
Make the struct and its methods generic over the type of value being tracked, | ||
that way `Counter` can track any type of value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A much better way to design this exercise!
I was originally planning on breaking these up into separate PRs in case some of the changes are more controversial than others, but it's probably easier to put them all up at once and remove the ones that other people don't like.
See the list of commits for a list of what changes I made. Each change is in its own commit, and most of them have a description elaborating on the motivation for the change.