Understanding Object-Oriented Programming

Learn about how object-oriented programming functions.

We'll cover the following

Object-oriented programming

In the 90s, another paradigm gained popularity and is still one of the essential paradigms in use. It is called object-oriented programming. Let’s see what this is about.

The main idea within object-oriented programming is to model the code in the same way that people (humans) look at the world. We are always classifying things and grouping things together using abstraction. We can talk about vehicles, and we have shared knowledge of what is included in this group. Cars, bicycles, boats, and airplanes are included, while pencils, ducks, and swimsuits are not.

For example, a friend could say to us, “I need to go to town. Can anyone lend me a vehicle?”

We’d probably interpret this in such a way that the actual kind of vehicle does not matter, but it must be something that can transport our friend to town. It could just as well be a car as it could be a skateboard.

Grouping things into these abstractions makes our lives easier because we won’t go into details every single time we talk about something. We can ask for a vehicle instead of describing that we need a device that can transport us from our current location to town.

Things within such an abstraction can be very different, but if they share some key characteristics, we will understand it. Take a look at the following image. Here, we have two items that can both be grouped into something that qualifies as remote control.

One of them will control our TV and let us change channels and change the volume. The other one will let us lock and unlock our car:

Get hands-on with 1400+ tech skills courses.