Programming paradigms are high-level strategies for structuring computer programs.
🛠Imperative & Procedural
- Imperative: Direct control over execution and state changes.
- Procedural: Organize logic into functions with data passed as inputs.
🧱 Object-Oriented (OO)
- Focused on "objects" that encapsulate state and behavior.
- Class-based: Inheritance via predefined classes.
- Prototype-based: Inheritance through other objects.
📜 Declarative
- Describe what to achieve, not how.
- Includes paradigms like:
- Functional: Compose pure functions.
- Reactive: Focus on data streams and change propagation.
🧩 Object-Oriented Programming (OOP)
OOP models systems around objects and their interactions.
🧬 Core Components
- Class: Blueprint stored in heap memory (supports abstraction).
- Struct: Lightweight structure stored in stack (no abstraction).
- Object: An instance with state, behavior, and identity.
- Communication: Objects interact via message passing.
🔗 Object Relationships
- Association: HAS-A relationship.