Object Oriented Programming Curriculum
Our students should have the skill to tackle real-world problems through code. But the real world is incredibly complex, and It becomes painfully cumbersome to handle that complexity with the top down approach of standard procedural programming. So, In this course, we move on to the bottom-up approach of Object Oriented Programming, a paradigm in which we combine data and functions into one encapsulated object. This abstraction allows us to model real-world scenarios in all its glory (complexity) with ease, giving us a chance to teach abstract thinking as a tool for problem-solving.
- Introduction to Object-Oriented Programming
We make students think of this world as an OOP world. A world where everything around us is an object with some properties (data) and some actions to perform (functions). We give examples and analogies from the world around them so that students can relate to the concept and understand it better. We show them the problems they face with procedural programming and make them solve those problems through OOP while building a fun personal jukebox project.
- Data & Methods Part I
In this lesson, we double down on the concept that we are in a world where everything around us is an object with some properties and some actions to perform. We show students the intimate relation that exists between these data variables and functions. By the end of the lesson, students can express those relations in python while building a digital phonebook of their own.
- Data & Methods Part II
The most important aspect of this course is to teach abstract thinking. In this lesson, we show them how a lot of objects that might look different on the surface can have common attributes making them belong to a single blueprint we call a class. We use avengers as a fun example, showing them how to express those common attributes through the code in python.
To err is human but that does not mean that our code has to suffer for human errors. Encapsulation is an essential principle in object-oriented programming which helps shield our code from human errors as well as provide a new way to organize information at a higher level. Using get and set methods of python, students encapsulate data and methods in one class while building a fun project about their favourite Hollywood stars.
- Inheritance Part I
In the real-world there are complex relations between objects; one such relationship is inheritance. We help students understand how attributes transfer from a parent class to a child class. They learn the relationship between different things around them, for ex- the relation between the parent term like “vehicles” and its child terms like “cars, buses, bikes and so on”. In this lesson, students model these relations in python using inheritance while building a fun project about cats and dogs.
Polymorphism means one method taking many forms. In this lesson, students learn to become efficient programmers by making methods that can perform different actions based on different data inputs. Students do not have to write the same code again to accommodate a different variable. We show students how to perform polymorphism in python by editing the cats and dogs project they built in the previous class.
We make students realise that every time they create an object, they are repeating specific steps over and over again. Students understand by practice that DRY (Don’t Repeat Yourself) is an essential aspect of excellent programming. Constructors help them set defaults, and perform some actions automatically as soon as the object is created. Constructors allow students to write code faster and remove repetition while defending earth against parasitic aliens from galaxies far far away.
- Inheritance Part II
In the previous lesson on Inheritance, students learnt the basics, but in this class, we go to an advanced level. We show how a child class can inherit from multiple parent classes. We let students appreciate the interconnectedness of different objects in the real world, by working on a project that combines attributes from the field of coding and wizardry to form objects that we call code wizards.
- Abstract Classes
Abstract thinking is the ultimate tool in problem-solving. It’s like having a chef’s knife that cuts through complexities with buttery ease. It’s usually hard for students to wrap their head around it, but we make it fun and relatable by giving real world examples of abstraction. Students write abstract classes and abstract methods in python while creating a project about abstraction between different species of animals.
It’s crucial for us that our students have the wisdom to choose the right tool for the job. While Inheritance is a popular way to express relations between objects, it does not work for relations where an object is made up of multiple sub-objects. We help students see how inheritance won’t work everywhere and then give them the tool of composition to express relationships between different parts of a single computer.
- Final Project Part I
- Final Project Part II
Object-oriented programming is a concept; it’s not a tool. So the stuff students learn in this course will be useful in almost every other programming language, and even outside programming while trying to find a solution to problems in their daily life. It’s important to solidify those principles in integration of each other. In these final lessons, we go through a journey of making a simple yet fun game from a blank canvas to reinforce and practice the important lessons learnt throughout this course.