Thursday - Lecture 16 - Methods
Date: July 16

Today we’ll talk about composing code with data through methods. These allow us to assign specific functionality to particular objects. When you combine them with the ideas of subtyping and inheritance…we now have all of the hallmarks of object-oriented programming which is an approach to programming that focuses on managing complexity through abstract objects.

Now, our custom structs can not only represent “static” data, but also have associated with them actions they can perform (methods). This means we can write more abstract programs that take into account of “objects” that are distinct, but also inherit from some more abstract struct definition (or class).

As usual, you might get this idea faster than the videos go. Feel free to skip straight to the demos after the intro, but if you’re confused, revisit the portions that you’re confused about.


In-Class Resources


📊 Slides
🏸 RKT Examples
🎬 Available Videos 🎥
Link Title Type Duration
Video 1 Lecture 16.1 - Introduction pre-recorded 8:40
Video 2 Lecture 16.2 - Abstract Types pre-recorded 4:44
Video 3 Lecture 16.3 - Examples! pre-recorded 5:22

Mini-Quiz 16: Subtyping and Methods

To take the mini-quiz associated with this lecture's content, you can use this link or find the quiz under the Quizzes page on Canvas.