Replies: 5 comments 4 replies
-
Hi @njr0, you're spot on that Joking aside, we've added a bit more commentary to this exercise over time since it wasn't clear at all what you can change and what you should leave alone. Right now, the hint about this is in the comment saying
That might be too subtle... could you make a PR to update the text before the big code listing to explain this better? |
Beta Was this translation helpful? Give feedback.
-
Thanks for coming back quickly, Martin (@mgeisler). To be honest, in my view, updating the text will make no difference because I suspect a overwhelming proportion of people (including me) won't read that text. It seems to me that the "contract" with these exercises is that the "desired behaviour" defines how it's supposed to work. That's what I learned in all the previous exercises. I think it's pedagologically duvbious to say (as you do)
and then use later comments to attempt to qualify that unqualified statement ("just kidding'!"). But it seems wrong anyway: you're just leaving the learner on quicksand. If I get to change Even if you do want the exercise to be "Here's the kind of thing you're supposed to make the code do, but feel free to change it however you need so it works", I still think your model answer should include the necessary change. So (with apologies) no, I won't make a PR to update the text, because I don't think the text is the problem. I'll make a PR to change main to include the |
Beta Was this translation helpful? Give feedback.
-
This raises an interesting issue that I've butted my head against a few times. We want students to get some familiarity with debugging errors from the compiler, since that comprises a greater portion of coding time in Rust than most other languages (made up for with less time typing and less time spent runtime debugging). So the idea in this exercise is to make the suggested implementation, including changing the given code as necessary, but I can certainly see why it feels like the given code can't be changed. Maybe I'm thinking of exercises as a chance to practice: a time- and complexity-bounded opportunity to work with Rust. If students want to take them in an unexpected direction, or not do them at all, that's fine! But if they're approached from the more academic perspective of homework or exam questions, then questions like "are we allowed to .." or "is it cheating to .." are more sensible. I'd be interested in ideas as to how we could push students toward considering these to be "practice sessions". |
Beta Was this translation helpful? Give feedback.
-
Oh, and the solution should definitely have the |
Beta Was this translation helpful? Give feedback.
-
I completely agree with that, and I think the rust compiler errors are one of the best features of rust. But I think if you're going to make it so that the main code isn't necessarily right, you need to establish that really early on. And I think anything you want people to fix that way, you can do in the code they (think they're) supposed to edit, not in the "This code defines the interface" (-like) |
Beta Was this translation helpful? Give feedback.
-
As far as I can see, the template code and solution both have a bug.
When
library
is created, it needs to be declared as mutable in order foradd_book
to work:i.e
rather than
Both my own solution and the model solution seem to fail without this:
Beta Was this translation helpful? Give feedback.
All reactions