Skip to content
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

Merged
merged 8 commits into from
Nov 15, 2023

Conversation

randomPoison
Copy link

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.

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.
@randomPoison
Copy link
Author

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.

Copy link
Owner

@djmitche djmitche left a 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!!!

Comment on lines +13 to +15
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.
Copy link
Owner

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!

@djmitche djmitche merged commit 84faa74 into djmitche:cr2-organization Nov 15, 2023
7 of 10 checks passed
@djmitche djmitche deleted the legare/v2-improvements branch November 15, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants