book icon indicating copy to clipboard operation
book copied to clipboard

Insufficiently-foreshadowed instructions to create "binary projects"

Open jruderman opened this issue 4 years ago • 1 comments

  • [x] I have checked the latest main branch to see if this has already been fixed
  • [x] I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:

ch03-03-how-functions-work.html:

Let’s start a new binary project named functions to explore functions further.

ch05-02-example-structs.html:

Let’s make a new binary project with Cargo called rectangles...

Description of the problem:

The term "binary project" has not been used up to this point. For a reader to understand this instruction (without skipping to chapter 7), they must make some correct guesses after synthesizing information from the following sections:

ch02-00-guessing-game-tutorial.html#setting-up-a-new-project:

make a new project using Cargo, like so:

$ cargo new guessing_game $ cd guessing_game

ch02-00-guessing-game-tutorial.html#using-a-crate-to-get-more-functionality:

Remember that a crate is a collection of Rust source code files. The project we’ve been building is a binary crate, which is an executable. The rand crate is a library crate, which contains code intended to be used in other programs.

Suggested fix:

  • Remove the word 'binary' from these sentences in chapter 3 and chapter 5.
  • Add "with Cargo" to the sentence in chapter 3. To avoid making the sentence unwieldy, perhaps move "to explore functions further" to the beginning of the sentence.

jruderman avatar Sep 09 '21 13:09 jruderman

I suspect the language here dates to before the switch to defaulting to generating binaries in Rust 1.25.

chriskrycho avatar Mar 27 '24 16:03 chriskrycho