Programming Paradigms
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 -= amountHere, 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
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:
- Better Organization : Code is structured into classes and objects instead of scattered functions.
- Encapsulation : Data is protected and controlled. No unnecessary global access.
- Reusability : Through inheritance and composition, code can be reused efficiently.
- Scalability : Large systems like banking apps, e-commerce platforms, and enterprise software rely heavily on OOP.
- 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:
passThink 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 = colorHere, 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
- What is a programming paradigm?
- What is Procedural Programming?
- What is Object-Oriented Programming?
- Can Python support both procedural and OOP?
- What is the main difference between Procedural and OOP?
- Why is procedural programming not ideal for large systems?
- Why is OOP preferred in enterprise applications?









