Sitemap
Saurabh Gandhi

Saurabh Gandhi

Python • AI • Tech Learning Writing simple guides that make coding easy for everyone.

Programming Paradigms

3 min readApr 3, 2026

--

Programming paradigms are different styles or approaches to writing software. They define how you structure code, how you organize logic, and how you model real-world problems.

Two of the most important paradigms every developer must understand are:

  • Procedural Programming
  • Object-Oriented Programming (OOP)

Modern languages like Python support both paradigms, which makes understanding their differences even more important.

Procedural vs Object-Oriented Programming

1. What is Procedural Programming?

Procedural Programming is based on writing procedures (functions) that operate on data.

It follows a step-by-step execution flow, where the program runs from top to bottom.

Languages that strongly follow this paradigm include:

  • C
  • Pascal

Key Characteristics:

  • Focus on functions
  • Data and functions are separate
  • Often uses global variables
  • Best for small programs and scripts

Example:

balance = 1000

def deposite(amount):
global balance
balance += amount

def withdraw(amount):
global balance
balance -= amount

Here, functions modify shared global data.

2. What is Object-Oriented Programming?

Object-Oriented Programming (OOP) is based on objects, which combine data and behavior together.

Instead of focusing only on functions, OOP focuses on modeling real-world entities.

Languages that heavily use OOP:

  • Java
  • C++

Key Characteristics:

  • Focus on objects
  • Data and methods bundled together
  • Better code organization
  • Highly scalable
  • Suitable for large applications

Example:

class BankAccount:
def __init__(self,balance):
self.balance = balance

def deposit(self, amount):
self.balance += amount

def withdraw(self, amount):
self.balance -= amount

account = BankAccount(1000)
account.deposit(500)

Here, data (balance) belongs to the object, not the global scope.

— — — — — — — — — — — — — — — — — — —

Comparison Table

Press enter or click to view image in full size

Why Object-Oriented Programming (OOP)?

As software grows, procedural code becomes harder to manage.

Get Saurabh Gandhi’s stories in your inbox

Join Medium for free to get updates from this writer.

OOP solves major real-world development problems:

  1. Better Organization : Code is structured into classes and objects instead of scattered functions.
  2. Encapsulation : Data is protected and controlled. No unnecessary global access.
  3. Reusability : Through inheritance and composition, code can be reused efficiently.
  4. Scalability : Large systems like banking apps, e-commerce platforms, and enterprise software rely heavily on OOP.
  5. Team Collaboration : Different developers can work on separate classes/modules without interfering with each other.

In short: OOP is designed for long-term, scalable, maintainable software development.

OOP Terminology (Class, Object, Attribute, Method)

Understanding basic OOP terminology is essential.

1. Class :

  • A Class is like an object constructor, or a “blueprint” for creating objects.
  • To create a class, use the keyword class
class Car:
pass

Think of it as a design template.

2. Object

  • An instance of a class.
car1 = Car()

If class is blueprint, object is the real product.

3. Attribute

  • Variables that belong to a class or object.
class Car:
def __init__(self, color):
self.color = color

Here, color is an attribute.

4. Method

  • A function defined inside a class.
class Car:
def start(self):
print("Car started")

Methods define behavior.

— — — — — — — — — — — — — — — — — — —

Quick Summary Table

Questions

  1. What is a programming paradigm?
  2. What is Procedural Programming?
  3. What is Object-Oriented Programming?
  4. Can Python support both procedural and OOP?
  5. What is the main difference between Procedural and OOP?
  6. Why is procedural programming not ideal for large systems?
  7. Why is OOP preferred in enterprise applications?

--

--

Saurabh Gandhi
Saurabh Gandhi

Written by Saurabh Gandhi

Python • AI • Tech Learning Writing simple guides that make coding easy for everyone.