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

Vectors are before Structures? #1787

Open
arthurkarganyan opened this issue Nov 26, 2023 · 3 comments
Open

Vectors are before Structures? #1787

arthurkarganyan opened this issue Nov 26, 2023 · 3 comments

Comments

@arthurkarganyan
Copy link

I'm new to Rust and I'm reading the Rust book and doing the rustlings exercises in parallel. And they seem to match the order of covered topics. However, the Vector chapter is number 8 in the book and Structures chapter is number 5, but in rustlings Vectors appear before Structures. I know, it's not a big deal, but maybe the order should be changed, I don't know.

@arthurkarganyan
Copy link
Author

The same for enums

@arthurkarganyan arthurkarganyan closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
@shadows-withal
Copy link
Member

Yeah, this is probably the biggest deviation we intentially make from the book. Both vecs and enums aren't conceptually too hard to understand, but they provide a gigantic boon in exercise structure the earlier they're implemented (nobody actually uses Rust arrays that much, and you won't see slices all that often either), so our "gamble" is that showing you Vecs and Enums before they're actually introduced in the book isn't too confusing, and instead helps make earlier exercises more understandable.

@ArmoredPony
Copy link

As a newbie, I still have to learn arrays just in case I run into them later. Some examples of arrays instead of vecs at this point (after primitive_types) would've been very welcome. And instead of vectors in move_semantics Strings could be used, like they are used in The Book to explain ownership and moving.

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

3 participants