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

Some minor docs improvements for TRPL #30755

Merged
merged 5 commits into from
Jan 9, 2016
Merged

Some minor docs improvements for TRPL #30755

merged 5 commits into from
Jan 9, 2016

Conversation

datagrok
Copy link
Contributor

@datagrok datagrok commented Jan 7, 2016

I'm working my way through TRPL beginning at "Syntax and Semantics" as was recommended in a previous version.

I'm expecting the chapter to incrementally build up my knowledge of the language section by section, assuming no prior Rust experience. So it was a bit of a speed-bump to encounter references and the vector type in a code example long before they had been defined and explained.

Another commit in this PR tries to make consistent what is a "chapter" of TRPL versus a "section." Just a nit-pick, but not thinking about that stuff keeps my focus on the important material.

My background: Python programmer since ~2000, with moderate exposure to C, C++, assembly, operating systems, and system architecture in university several years ago.

For your kind consideration, feel welcome to use or drop or rework any part of this.

In a straight-through read of "Syntax and Semantics," the first time we
meet a generic, and the first time we meet a vector, is when a Vec<T> shows
up in this example. I'm not sure that I could argue that the whole section
should appear later in the book than the ones on vectors and generics, so
instead just give the reader a brief introduction to both and a promise to
follow up later.
In a straight-through read of "Syntax and Semantics," the concept of a
"reference" is used here before it is explained. Mention that and link to
the section explaining references.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

related to the vector, even the heap-allocated memory. This happens
deterministically, at the end of the scope.
When `v` comes into scope, a new [vector][] is created, and it allocates space
on the heap for each of its elements. When `v` goes out of scope at the end of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the link to the heap section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! That was accidental. Will do.

@Manishearth
Copy link
Member

Thanks for the improvements!

r? @steveklabnik on the chapter/section stuff

@@ -14,7 +14,7 @@ Even then, Rust still allows precise control like a low-level language would.

[rust]: https://www.rust-lang.org

“The Rust Programming Language” is split into sections. This introduction
“The Rust Programming Language” is split into chapters. This introduction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has always been a confusing-ish pain point: what is a section and what is a chapter? Syntax and Semantics is wayyy to long for a chapter, but the others are too short.

Oh well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considered LaTeX-style Part / Chapter / Section divisions? Not all Parts need to be broken into Chapters, iirc. But maybe this is only intuitive for me because I've authored LaTeX documents before. Probably not worth a bikeshed discussion, so I won't modify this any further within this PR.

@steveklabnik
Copy link
Member

Hey @datagrok ! Thanks so much for this!

So it was a bit of a speed-bump to encounter references and the vector type in a code example long before they had been defined and explained.

Yeah, I worked really hard to not have forward references originally, but some snuck in. Thanks for noticing.

Would you mind editing out the []s? Happy to merge this after.

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Jan 7, 2016

📌 Commit fcc3563 has been approved by steveklabnik

@steveklabnik
Copy link
Member

Thanks again!

steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 8, 2016
I'm working my way through TRPL beginning at "Syntax and Semantics" as was recommended in a previous version.

I'm expecting the chapter to incrementally build up my knowledge of the language section by section, assuming no prior Rust experience. So it was a bit of a speed-bump to encounter references and the vector type in a code example long before they had been defined and explained.

Another commit in this PR tries to make consistent what is a "chapter" of TRPL versus a "section." Just a nit-pick, but not thinking about that stuff keeps my focus on the important material.

My background: Python programmer since ~2000, with moderate exposure to C, C++, assembly, operating systems, and system architecture in university several years ago.

For your kind consideration, feel welcome to use or drop or rework any part of this.
bors added a commit that referenced this pull request Jan 8, 2016
@bors bors merged commit fcc3563 into rust-lang:master Jan 9, 2016
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.

5 participants