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

Exercise order: string before struct #520

Closed

Conversation

ephetic
Copy link

@ephetic ephetic commented Sep 21, 2020

The struct exercises rely on knowledge learned in the string exercises, so should follow rather than precede them.

The struct exercises rely on knowledge learned in the string exercises, so should follow rather than precede them.
@ephetic
Copy link
Author

ephetic commented Sep 21, 2020

Just discovered result1.rs comes long after errorsn.rs which clearly extends it. This PR maybe needs to be closed in favor of a broader review of exercise order.

@floriantz
Copy link

floriantz commented Nov 15, 2020

I am currently in the process of going through exercises for the first time as I wanted some practice writing rust code, and I had the same reflection.

Following the compiler I instinctively ended up using &str for the c and tuple struct, which then led me to introducing lifetimes. And using borrowed time for a struct like this doesn't really seems like a good pattern to me.

After some research I've eventually used String before even getting to the strings exercises that would have helped a lot.

Also since the quizz2 ends the Strings exercise it should probably be moved just after them in the PR.

@AbdouSeck
Copy link
Contributor

Hi all, I am closing this PR in favor of #541. Struct before String is a bit hard to wrap one's head around. But remember that the String type in rust is a fat pointer to some buffer of data. You can use String typed data without having to know anything about how they behave. So, it would make sense to use them in structs before really understanding how they work.

@AbdouSeck AbdouSeck closed this Dec 7, 2020
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.

3 participants