欢迎来到第一天

This is the first day of Rust Fundamentals. We will cover a lot of ground today:

  • Rust 基本语法:变量,标量(scalar)和复合(compound)类型,枚举(enum),结构体(struct),引用,函数和方法。

  • 控制流的构造: if, if let, while, while let, break, 和 continue

  • 模式匹配: 解构枚举, 结构体和数组(array)。

请提醒学生:

  • 他们可以随时提问,不需要留到最后。
  • 这个课程本应该是互动的,我们鼓励大家积极讨论。
    • As an instructor, you should try to keep the discussions relevant, i.e., keep the discussions related to how Rust does things vs some other language. It can be hard to find the right balance, but err on the side of allowing discussions since they engage people much more than one-way communication.
  • 有些问题会导致我们提前谈到后面的内容
    • 这完全没有问题! 重复是学习的一个重要方法。请记得 这些幻灯片只是一个辅助,你可以选择性地跳过。

第一天的主要目标是要谈到著名的 borrow checker,其他方面点到为止。Rust 处理内存的方式是其主要特点,这点我们应该尽早展示给学生。

如果你是在教室里教授此课程,不妨在这里介绍一下时间安排。 这边建议是把每天分成两部分(跟着幻灯片来):

  • 早上:9:00 到 12:00,
  • 下午:13:00 到 16:00。

当然你也可以看情况调整时间。但是请务必记得提供休息时间。我们建议每个小时休息一次!