Procedural Programming
Idea: A program is a sequence of step-by-step instructions.
- Uses functions or procedures
- Variables change over time
- Control flow using loops and conditions
Common languages: C, Pascal
int x = 5;
x = x + 1;
x = x + 1;
Object-Oriented Programming (OOP)
Idea: A program is built from interacting objects.
- Classes and objects
- Encapsulation and abstraction
- Inheritance and polymorphism
Common languages: Java, C++, Python
class Car {
void drive() {}
}
void drive() {}
}
Functional Programming
Idea: A program is a composition of mathematical functions.
- Functions are first-class values
- Immutability (no changing data)
- Based on Lambda Calculus
- Focus on expressions, not statements
Common languages: Haskell, Lisp, Scala basic syntax , Python (partially)
f = lambda x: x + 1
f(5)
f(5)
Declarative Programming
Idea: Describe what you want, not how to do it.
- No explicit control flow
- The system decides execution details
Examples: SQL, HTML, CSS
SELECT * FROM users WHERE age > 18;
Logic Programming
Idea: Programs are written as facts and rules.
- Focus on relationships
- Used in AI and rule-based systems
Common language: Prolog
Event-Driven Programming
Idea: The program reacts to events.
- Events like clicks, gestures, messages
- Uses callbacks and handlers
Examples: Web apps, GUIs, games, VR systems
Concurrent and Parallel Programming
Idea: Multiple computations happen at the same time.
- Threads and processes
- Async and parallel execution
- Synchronization challenges
Common languages: Java, Go, Python