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.
Today's Resources
1. Exercise Files
Download Exercise Files2. Slides
3. Pre-Recorded Lecture Video(s), Mini-Quizzes, and Live Recordings
| Link | Title | Type | Duration |
|---|---|---|---|
| Video 0 | Intro | pre-recorded | 5:52 |
| Video 1 | Methods | pre-recorded | 5:53 |
| Video 2 | Abstract Types | pre-recorded | 5:50 |
| Video 3 | Object-Oriented Programming | pre-recorded | 2:15 |
| Video 4 | (Demos) Basic Methods | pre-recorded | 6:00 |
| Video 5 | (Demos) Writing Custom Methods (MQ - No Longer Available) | video_quiz | 9:51 |