欢迎来到第一天

今天是学习 Comprehensive Rust 的第一天。我们会涉及很多内容:

  • Rust 基本语法:变量、标量(scalar)和复合(compound)类型、枚举(Enum)、结构体(struct)、引用、函数和方法。
  • Types and type inference.
  • 控制流结构:循环、条件语句等。
  • 用户定义的类型:结构体和枚举。
  • 模式匹配:解构枚举、结构体和数组(array)。

时间表

Including 10 minute breaks, this session should take about 2 hours and 40 minutes. It contains:

SegmentDuration
欢迎5 minutes
Hello, World20 minutes
类型和值55 minutes
控制流基础55 minutes
This slide should take about 5 minutes.

请提醒学生:

  • 他们可以随时提问,不需要留到最后。
  • 这个课程本应该是互动的,我们鼓励大家积极讨论。
    • 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.
  • 有些问题会导致我们提前谈到后面的内容。
    • 这完全没有问题!重复是学习的一个重要方法。请记住,这些幻灯片只是一种辅助,你可以选择性地跳过。

第一天的目标是展示 Rust 中与其他编程语言有明显相似之处的 “基础”内容。Rust 中更高级复杂的内容将在后续几天中逐步介绍。

如果您是在教室里授课,则这是一个好时机,可对课程时间表进行讲解。请注意,每节课结束之后会有练习内容,然后是休息时间。安排在休息结束后讲解练习内容的解答。为了确保课程按时间表进行,此处所列时间仅供参考。请按需进行灵活调整!