-
Notifications
You must be signed in to change notification settings - Fork 540
Confusion with Xorcism exercise #1040
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
Comments
Great feedback! Xorcism is the newest exercise in the Rust track, and I'm very happy to have experience reports like this to improve it. I'm going to restate your points, with my responses appended. This is to ensure I haven't misunderstood or overlooked anything. If I have, then it is unintentional; please feel free to update me.
Overall, I'd be positively inclined toward a PR implementing your suggestions with the exception of defaulting |
You expressed each of my points perfectly, thank you! I also agree with your final point: I think a comment in the I'll put together a PR based on this discussion, thank you for the quick response! |
A coworker pointed me to the Xorcism exercise, and pointed out some difficulty with it. We both ultimately worked through it, and the exercise overall was a great stress test of the interaction of lifetimes and
impl Trait
. However, IMO, in its current incarnation it deserves to be bumped from Medium to Hard. And even so, I would recommend providing some additional guidance in the instructions, and perhaps some simplifications.Some parts of the exercise, in particular the
ExactSizeIterator
, seem to be unnecessary. My solution ultimately did not leverage that trait, and it's unclear why it would be needed from the test suite.I would also recommend introducing a few simple test cases of
munge_in_place
beforemunge
, so that someone implementing it can get a feel for how munging is supposed to work before diving into the more complicated issues with streaming and lifetimes.Finally, I would recommend making the
impl Trait
approach a bonus point, and instead recommend starting with a concretestruct
. I looked at a number of the existing solutions on Exercism, and it seems like that is the most intuitive place to start. It also avoids the major complexity around lifetimes andimpl Trait
.I'd be happy to open a PR to make some of these modifications, but wanted to start with a discussion issue first.
Note that I've also opened rust-lang/rust#80518 for some surprising compiler behavior around this exercise.
The text was updated successfully, but these errors were encountered: