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

Improve hints for traits, generics and Quiz3 #1426

Closed
1oglop1 opened this issue Mar 14, 2023 · 3 comments
Closed

Improve hints for traits, generics and Quiz3 #1426

1oglop1 opened this issue Mar 14, 2023 · 3 comments

Comments

@1oglop1
Copy link

1oglop1 commented Mar 14, 2023

Hi, I am completely new to Rust and trying these exercises. I am familiar with Python and more or less TypeScript.

Up until Generics and Traits everything was well explained and hints provided enough information on what to read.

However, the traits section does not provide much information at all.

The description and hints in quiz3 assume a lot of knowledge which wasn't previously mentioned.

In the description it says

// to support alphabetical report cards. Change the Grade in the second test to "A+"
// to show that your changes allow alphabetical grades.

but the todo note is

// TODO: Make sure to change the grade here after you finish the exercise.

Hint goes as:

To find the best solution to this challenge you're going to need to think back to your
knowledge of traits, specifically Trait Bound Syntax -  you may also need this: `use std::fmt::Display;`.

I do not remember the term Trait Bound Syntax being mentioned before. Also, there was no opportunity to try use std::fmt::Display;.

This makes the quiz very complicated for me because I am unable to associate the hint with the information from the rust book or rust by example.

It would be great if the text contained more links to examples.

What actually helped me to finish the exercise was
First make the change of

grade: 2.1,
to A+

And then the compiler complained that the grade expected f32 but found &str. Which ultimately lead me to use what I learned in generics2 -> pub struct ReportCard<T> and after implementing all this the compiler suggested using std::fmt::Display;.

  • I'd probably move the todo directly above the line which is supposed to be changed
    fn generate_alphabetic_report_card() {
    // TODO: Make sure to change the grade here after you finish the exercise.
    let report_card = ReportCard {
    grade: 2.1,
    student_name: "Gary Plotter".to_string(),
    student_age: 11,
fn generate_alphabetic_report_card() {
        let report_card = ReportCard {
        // TODO: Change 2.1 to "A+"
            grade: 2.1,
            student_name: "Gary Plotter".to_string(),
            student_age: 11,
@Eshanatnight
Copy link

Hey! So in my opinion, I think the it is a good practice to read the README.md files as you progress. I understand that it takes you out of the immersion and the flow.

As for the std::fmt::Display, yes there is no explicit exercise that shows how to use builtin traits. So someone going through the exercise can go here, it is linked in the README file.

@asadsnowman
Copy link

I agree that this quiz seems to need a bit of improvement. I read the Rust Book up through chapter 15 before starting the rustlings and breezed through almost everything until quiz3, where I was completely stumped until I googled solutions. Why even make the student change the second test from 2.1 to "A+"? That seems to add a whole separate layer of complication to a quiz that already asks you to make abnormally large leaps in logic and knowledge compared to previous problems and quizzes.

@mo8it
Copy link
Contributor

mo8it commented Jul 7, 2024

Version 6 improved the exercise a lot. Most importantly, the grade in the test is already changed to "A+".

If you still have any suggestions for the current version, I can reopen the issue :)

@mo8it mo8it closed this as completed Jul 7, 2024
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

4 participants