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

Chapter 4.1 Question 3 #222

Open
simgar opened this issue Nov 9, 2024 · 0 comments
Open

Chapter 4.1 Question 3 #222

simgar opened this issue Nov 9, 2024 · 0 comments

Comments

@simgar
Copy link

simgar commented Nov 9, 2024

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • 4.1
    • compiler
    • optimisation
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • ch04-01-ownership-sec2-moves.toml

URL to the section(s) of the book with this problem:

https://github.com/cognitive-engineering-lab/rust-book/blob/main/quizzes/ch04-01-ownership-sec2-moves.toml

Description of the problem:

At this point the book, you haven’t dealt with compiler optimisations. Any experienced person could expect this code to be optimised out. You use a wrong answer as a teachable moment - that’s not good teaching if you haven’t already taught the subject.

This is the most complicated subject in Rust, it seems to me from what I read around the subject - I’ve already read the print book (2021) chapter once and I’m on my second* go around the interactive version - I don’t need a trick question at this point.

  • I got to the end of chapter 8, before the second ownership inventory, and was still making ownership mistakes, so I went back to chapter 4.

Suggested fix:

Use a random number generator or ask the user for input.

Note:
Overall, I like the new permissions-based approach in the interactive version - I’ve found it really helpful, having already read the print version. But even having read both, I was still only getting about 50% of the questions. The ones that ask what the Rust doesn’t do have been particularly troublesome, e.g. question 4 in this block.

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

No branches or pull requests

1 participant