What is Object-Oriented Programming (Principles)

Ayman Lar
2 min readOct 16, 2021

Object-oriented programming is a popular programming paradigm used by nearly every developer at some point in their career, OOP is based on data (attributes or properties) also code (methods) . It is build on the idea that problems can be broken down in terms of the objects required to solve it.

Today we will break down the basics of what makes a program object-oriented so that you can start to utilize this paradigm in your own projects

What are Classes and Objects?

Classes (blueprint) and objects (instance) are the two main aspects of object-oriented programming.

classes specifies that members (attributes and methods) of the class are accessible from outside the class.

object is created from a class, created with specific data, for example A Car is an object. Its attributes are its engine, color, model, etc. while its service is to help people travel.

from https://learnscripting.org/python-oops-concept/

Four Principles of OOP :

The four pillars of object oriented programming are:

  • Inheritance: child classes inherit data and methods from parent class .
  • Encapsulation: containing information in an object bundled together .
  • Abstraction: only exposing high level public methods for accessing an object ( find the objects which can solve the problem and use their services)
  • Polymorphism: many methods can do the same task

--

--

Ayman Lar

I work on a lot of random projects because the web needs some new shit.