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

rust book refers to 'str' primitive type as if it has already been introduced #30162

Closed
ntuckerxx opened this issue Dec 2, 2015 · 6 comments · Fixed by #30595
Closed

rust book refers to 'str' primitive type as if it has already been introduced #30162

ntuckerxx opened this issue Dec 2, 2015 · 6 comments · Fixed by #30595

Comments

@ntuckerxx
Copy link

I'm going through the rust book and have gotten to the Dining Philosophers section, at which point I've encountered the following text:

We choose the String type for the name, rather than &str.

None of the previous introduction has even mentioned a str type, so I had to go looking to find out what it is and how it differs from String. The example seems to assume that the reader would find str the obvious choice, but the reader hasn't heard of str at this point.

I'm brand new to rust myself so I'm not sure how this could be introduced better, but I think simply using String and not mentioning str would be less confusing at this point.

@steveklabnik
Copy link
Member

Taking that path first, rather than going through Syntax and Semantics, is a "throw you in the deep end" style thing, so it's a bit faster and looser with the forward references. That said, this could be better, for sure.

@ntuckerxx
Copy link
Author

I have to admit, it's a bit baffling that the "intro" path (Syntax and Semantics) is the one that requires you to jump out of TOC order of the book. When you get to the decision point, your only clue is:

Welcome! This section has a few tutorials that teach you Rust through building projects. You’ll get a high-level overview, but we’ll skim over the details.

If you’d prefer a more ‘from the ground up’-style experience, check out Syntax and Semantics.

The fact that the path labeled "tutorials" is apparently the "throw you in the deep end" path is very unclear. I would generally expect that the linear in-order path through the book's TOC is the friendliest and most self-contained intro to the language.

Furthermore, it's very strange that chapter 4 relies on a lot of knowledge that isn't introduced until chapter 5. I think the book could benefit from chapter 3 including a heavily abridged version of chapter 5 which introduces some of the important syntax early on without needing to crawl through every detail.

@steveklabnik
Copy link
Member

I have to admit, it's a bit baffling that the "intro" path (Syntax and Semantics) is the one that requires you to jump out of TOC order of the book

I had it the other way, people complained, I moved it this way, people complain. Can't win :(

That said, the TOC is gonna change radically so that issue will apparently just Go Away.

The fact that the path labeled "tutorials" is apparently the "throw you in the deep end" path is very unclear.

It is literally above the fold on the first page of the book. Not sure how else to make the relationship even more clear.

@ntuckerxx
Copy link
Author

It is literally above the fold on the first page of the book. Not sure how else to make the relationship even more clear.

I'm not seeing that clarity. The description of the two choices on the first page still leaves me with the impression that "Learn Rust" is going to be the easy path, and "Syntax and Semantics" is going to be thorough technical descriptions of every language feature (this is reinforced by a glance at the subheadings in chapter 5). Many programming intro books give you a choice between the soft, example-laden ease-in and the dry technical slog through more reference-like material, and I think perhaps the root issue (and the reason people complain either way you order it) is that it sounds like this is the choice you're offering, but it's not.

To be perfectly clear, here is the relevant text:

‘Learn Rust’ if you want to dive in with a project, or ‘Syntax and Semantics’ if you prefer to start small, and learn a single concept thoroughly before moving onto the next.

I read this as "follow 'Learn Rust' if you want your hand held through some sample code" and "follow 'Syntax and Semantics' if you prefer to learn a language by sitting down and reading the reference book."

Please keep in mind that at this point, I'm intentionally trying to look at this from a no-prior-knowledge point of view to help you understand what's frustrating people. Despite these small bumps, I find the book to be an excellent intro; I just think this navigational issue could be improved to get more people to successfully use the book.

@steveklabnik
Copy link
Member

To be clear here, I'm not saying the situation isn't unfortunate, It's why there's going to be a reorganization.

@steveklabnik
Copy link
Member

#30271 is a quick fix to help a bit for a related problem, but it doesn't fix this exact issue.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Dec 28, 2015
Some history:

While getting Rust to 1.0, it was a struggle to keep the book in a
working state. I had always wanted a certain kind of TOC, but couldn't
quite get it there.

At the 11th hour, I wrote up "Rust inside other langauges" and "Dining
Philosophers" in an attempt to get the book in the direction I wanted to
go. They were fine, but not my best work. I wanted to further expand
this section, but it's just never going to end up happening. We're doing
the second draft of the book now, and these sections are basically gone
already.

Here's the issues with these two sections, and removing them just fixes
it all:

// Philosophers

There was always controversy over which ones were chosen, and why. This
is kind of a perpetual bikeshed, but it comes up every once in a while.

The implementation was originally supposed to show off channels, but
never did, due to time constraints. Months later, I still haven't
re-written it to use them.

People get different results and assume that means they're wrong, rather
than the non-determinism inherent in concurrency. Platform differences
aggrivate this, as does the exact amount of sleeping and printing.

// Rust Inside Other Languages

This section is wonderful, and shows off a strength of Rust. However,
it's not clear what qualifies a language to be in this section. And I'm
not sure how tracking a ton of other languages is gonna work, into the
future; we can't test _anything_ in this section, so it's prone to
bitrot.

By removing this section, and making the Guessing Game an initial
tutorial, we will move this version of the book closer to the future
version, and just eliminate all of these questions.

In addition, this also solves the 'split-brained'-ness of having two
paths, which has endlessly confused people in the past.

I'm sad to see these sections go, but I think it's for the best.

Fixes rust-lang#30471
Fixes rust-lang#30163
Fixes rust-lang#30162
Fixes rust-lang#25488
Fixes rust-lang#30345
Fixes rust-lang#29590
Fixes rust-lang#28713
Fixes rust-lang#28915

And probably others. This lengthy list alone is enough to show that
these should have been removed.

RIP.
Manishearth added a commit to Manishearth/rust that referenced this issue Dec 29, 2015
…ankro

Some history:

While getting Rust to 1.0, it was a struggle to keep the book in a
working state. I had always wanted a certain kind of TOC, but couldn't
quite get it there.

At the 11th hour, I wrote up "Rust inside other langauges" and "Dining
Philosophers" in an attempt to get the book in the direction I wanted to
go. They were fine, but not my best work. I wanted to further expand
this section, but it's just never going to end up happening. We're doing
the second draft of the book now, and these sections are basically gone
already.

Here's the issues with these two sections, and removing them just fixes
it all:

// Philosophers

There was always controversy over which ones were chosen, and why. This
is kind of a perpetual bikeshed, but it comes up every once in a while.

The implementation was originally supposed to show off channels, but
never did, due to time constraints. Months later, I still haven't
re-written it to use them.

People get different results and assume that means they're wrong, rather
than the non-determinism inherent in concurrency. Platform differences
aggrivate this, as does the exact amount of sleeping and printing.

// Rust Inside Other Languages

This section is wonderful, and shows off a strength of Rust. However,
it's not clear what qualifies a language to be in this section. And I'm
not sure how tracking a ton of other languages is gonna work, into the
future; we can't test _anything_ in this section, so it's prone to
bitrot.

By removing this section, and making the Guessing Game an initial
tutorial, we will move this version of the book closer to the future
version, and just eliminate all of these questions.

In addition, this also solves the 'split-brained'-ness of having two
paths, which has endlessly confused people in the past.

I'm sad to see these sections go, but I think it's for the best.

Fixes rust-lang#30471
Fixes rust-lang#30163
Fixes rust-lang#30162
Fixes rust-lang#25488
Fixes rust-lang#30345
Fixes rust-lang#29590
Fixes rust-lang#28713
Fixes rust-lang#28915

And probably others. This lengthy list alone is enough to show that
these should have been removed.

RIP.
steveklabnik added a commit to steveklabnik/rust that referenced this issue Dec 29, 2015
Some history:

While getting Rust to 1.0, it was a struggle to keep the book in a
working state. I had always wanted a certain kind of TOC, but couldn't
quite get it there.

At the 11th hour, I wrote up "Rust inside other langauges" and "Dining
Philosophers" in an attempt to get the book in the direction I wanted to
go. They were fine, but not my best work. I wanted to further expand
this section, but it's just never going to end up happening. We're doing
the second draft of the book now, and these sections are basically gone
already.

Here's the issues with these two sections, and removing them just fixes
it all:

// Philosophers

There was always controversy over which ones were chosen, and why. This
is kind of a perpetual bikeshed, but it comes up every once in a while.

The implementation was originally supposed to show off channels, but
never did, due to time constraints. Months later, I still haven't
re-written it to use them.

People get different results and assume that means they're wrong, rather
than the non-determinism inherent in concurrency. Platform differences
aggrivate this, as does the exact amount of sleeping and printing.

// Rust Inside Other Languages

This section is wonderful, and shows off a strength of Rust. However,
it's not clear what qualifies a language to be in this section. And I'm
not sure how tracking a ton of other languages is gonna work, into the
future; we can't test _anything_ in this section, so it's prone to
bitrot.

By removing this section, and making the Guessing Game an initial
tutorial, we will move this version of the book closer to the future
version, and just eliminate all of these questions.

In addition, this also solves the 'split-brained'-ness of having two
paths, which has endlessly confused people in the past.

I'm sad to see these sections go, but I think it's for the best.

Fixes rust-lang#30471
Fixes rust-lang#30163
Fixes rust-lang#30162
Fixes rust-lang#25488
Fixes rust-lang#30345
Fixes rust-lang#28713
Fixes rust-lang#28915

And probably others. This lengthy list alone is enough to show that
these should have been removed.

RIP.
bors added a commit that referenced this issue Jan 5, 2016
Some history:

While getting Rust to 1.0, it was a struggle to keep the book in a
working state. I had always wanted a certain kind of TOC, but couldn't
quite get it there.

At the 11th hour, I wrote up "Rust inside other langauges" and "Dining
Philosophers" in an attempt to get the book in the direction I wanted to
go. They were fine, but not my best work. I wanted to further expand
this section, but it's just never going to end up happening. We're doing
the second draft of the book now, and these sections are basically gone
already.

Here's the issues with these two sections, and removing them just fixes
it all:

// Philosophers

There was always controversy over which ones were chosen, and why. This
is kind of a perpetual bikeshed, but it comes up every once in a while.

The implementation was originally supposed to show off channels, but
never did, due to time constraints. Months later, I still haven't
re-written it to use them.

People get different results and assume that means they're wrong, rather
than the non-determinism inherent in concurrency. Platform differences
aggrivate this, as does the exact amount of sleeping and printing.

// Rust Inside Other Languages

This section is wonderful, and shows off a strength of Rust. However,
it's not clear what qualifies a language to be in this section. And I'm
not sure how tracking a ton of other languages is gonna work, into the
future; we can't test _anything_ in this section, so it's prone to
bitrot.

By removing this section, and making the Guessing Game an initial
tutorial, we will move this version of the book closer to the future
version, and just eliminate all of these questions.

In addition, this also solves the 'split-brained'-ness of having two
paths, which has endlessly confused people in the past.

I'm sad to see these sections go, but I think it's for the best.

Fixes #30471
Fixes #30163
Fixes #30162
Fixes #25488
Fixes #30345
Fixes #29590
Fixes #28713
Fixes #28915

And probably others. This lengthy list alone is enough to show that
these should have been removed.

RIP.
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 a pull request may close this issue.

3 participants