ƒ Procedural
•Data and functions are separate
•Functions receive data as parameters
•Variables and functions = building blocks
•Functions operate on external data
accelerate(brand, speed);
VS
◆ Object-Oriented
•Data and behavior are bundled
•Objects own and manage their data
•Objects = building blocks (data + behavior)
•Objects expose behavior selectively
car.accelerate();
Select a Concept
⇄
Procedural vs. OOP
From functions-on-data to objects that own their data
In procedural programming, data and functions are separate — functions receive data, process it, and return results. In OOP, data and the functions that operate on it are bundled together into objects. Instead of passing a car's data to standalone functions, you create a Car object that knows its own state and exposes behavior through methods. This shift from "functions operate on data" to "objects manage their own data" is the heart of OOP.
Key Ideas
1Procedural: variables + functions are separate building blocks
2OOP: objects bundle variables (state) and functions (behavior) together
3Procedural functions operate on external data; OOP methods operate on internal data
4OOP groups variables and functions by context — modeling real-world entities
Strengths
- ✦Code is organized around real-world concepts
- ✦Data is protected from unintended modifications
- ✦Easier to maintain and extend large codebases
- ✦Better code reusability through classes
Weaknesses
- △More boilerplate than procedural for simple tasks
- △Steeper learning curve for beginners
- △Over-engineering risk with unnecessary abstractions
Used in:Enterprise apps, mobile apps, game development, GUI frameworks
Procedural vs. OOP Quiz
Procedural vs. OOP Quiz
QUIZ 1/7What is the key difference between procedural and OOP?
Practice Exercises
Classify each concept: Is it part of a Class definition or an Object at runtime?
EXERCISE 1/3Blueprint / Template
Has its own state in memory
Method definitions
Occupies memory at runtime
Logical entity
Physical entity
Class
Object
Match each OOP building block to its role.
EXERCISE 2/3Attributes
Methods
Constructor
Class
Object
State / Fields of an object
Behavior of an object
Initializes a new object
Blueprint / template
Instance created from a class
Categorize: Constructor feature or Regular Method feature?
EXERCISE 3/3Same name as the class
Has a return type
Called once at creation
Can be called many times
No return type (not even void)
Can have any name
Constructor
Regular Method