So far, we've been using a procedural programming style to write computer programs. Procedural programming focuses on defining functions (procedures) as sequences of instructions to execute. While we've used control structures (e.g., conditionals and loops) to redirect the program flow, and data structures (e.g., lists and dictionaries) to organize data, we have designed programs primarily based on which lines of code execute in what order.
Object-oriented programming is a programming paradigm (style) in which we don't design programs around the sequence of statements executed, but around the specification of objects which are combinations of data (variables) and behaviors (functions). Objects are used to represent elements in the program's real-world problem domain, and provide a useful abstraction when designing programs: instead of needing to think about code statements executing in order, we can think about telling "things" to perform "actions".
In this module, we will discuss the fundamentals of object-oriented programming and how to specify classes (custom data types) that are used to define and create objects.
Contents
- Classes and Objects - The Basics (Downey)
- Classes and Objects - Digging a little deeper (Downey)
- Even more OOP (Downey)
This module is under development. In the meantime, reference the lecture slides at https://slides.com/joelross/infx598s17-oop.