Book: Topics in old ch 3/new ch 4 - should we keep them all?

Created on 28 Jul 2016  路  9Comments  路  Source: rust-lang/book

Mostly making notes for the discussion i'm having with aaron tomorrow. This is not the issue you're looking for. You can go about your business.

Anatomy of a Rust Program

A Simple Program that Binds a Variable

Starting a Program with the main() Function

Binding a Variable with let

Printing to the Screen with a Macro

Variable Bindings in Detail

Creating Multiple Bindings (cut?)

Delayed Initialization

Mutable bindings

Variable Binding Scope

Shadowing Earlier Bindings

Shadowing Over Bindings

Shadowing and Scopes (this is a lot of space spent on shadowing, maybe that can be condensed?)

Data Types

Type Inference and Annotation

Scalar Types

Integer Types

Floating-Point Types

Numeric Operations

The Boolean Type

The Character Type

Compound Types

Grouping Values into Tuples

Tuple Indexing

Arrays

Type Annotation for Arrays

Using Debug in the println! Macro

Accessing and Modifying Array Elements

Invalid array element access

How Functions Work

Function Arguments

Variable Bindings as Arguments (cut?)

Function Bodies

Statements and Expressions

Functions with Return Values

Returning Multiple Values (cut?)

Comments

Documentation Comments

Control Flow

if Expressions

Multiple Conditions with else if

Using if in a Binding

Repetition with Loops

Repeating Code with loop

Conditional Loops With while

Looping Though a Collection with for

All 9 comments

  • Remove duplication with hello world/tutorial - if we assume people have read hello world & guessing game tutorial, perhaps all of "anatomy of a rust program" can go/be worked into those places?
  • cut Creating Multiple Bindings
  • cut Delayed Initialization, move first error message box to Mutable bindings
  • cut Variable Scope
  • cut shadowing

That leaves us with mutable bindings, change top level to variable mutability, expand more about WHY variable mutability and default immutability is important

Idea: Patterns (currently a subsection under Enums) should be a top-level chapter instead

  • cut type annotation (move to new patterns chapter)
  • remove Debug println from Arrays - move to structs
  • Cut arrays down, mention they exist, and that you probably want a Vec
  • cut variable bindings as arguments
  • expand statements and expressions since we're cutting the discussion from variable bindings There actually wasn't much meaty content that was cut, I think the discussion in functions is okay as-is.
  • cut multiple returns -- introduce where we use it in ownership instead
  • move doc comments to some future chapter that discusses making good libraries
  • Change looping section to just mention loop and while, but recommend and spend more time on for, and point out benefits
  • condense basic if description

Ok, this should all be done, on the first third branch :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elahn picture elahn  路  3Comments

rpjohnst picture rpjohnst  路  4Comments

mikebenfield picture mikebenfield  路  3Comments

nathany picture nathany  路  3Comments

binarycrusader picture binarycrusader  路  4Comments