Functional Programming vs Object-Oriented Programming

Master the two dominant programming paradigms: pure functions, composition, and immutability versus objects, encapsulation, and inheritance โ€” with a practical framework for when to use each.

intermediate 75 min 9 lessons

Lessons

  • Two Ways of Thinking

    Programming paradigms: where behavior lives and how data moves, from imperative to declarative.

    8 min
  • The Heart of FP โ€” Pure Functions

    Determinism, side effects, and referential transparency โ€” and why purity makes code testable, cacheable, and parallel-safe.

    10 min
  • Functions as Values

    First-class functions, higher-order functions, map/filter/reduce, and closures โ€” passing behavior around like data.

    9 min
  • Composition & Pipelines

    Building programs as data flow: function composition, pipelines, and why small pure stages beat nested imperative logic.

    10 min
  • Immutability โ€” State as a Value

    Shared mutable state as the root of bugs, structural sharing, and the reducer pattern for managing state without mutation.

    10 min
  • The OOP Model โ€” Objects All the Way Down

    Encapsulation, abstraction, inheritance, and polymorphism: bundling state and behavior, and where OOP genuinely shines.

    10 min
  • Head-to-Head

    Side-by-side comparison across state, testing, concurrency, reuse, and refactoring โ€” plus the honest weaknesses of each paradigm.

    10 min
  • When to Use Which

    A practical decision framework: FP-first problems, OOP-first problems, the functional core / imperative shell pattern, and ecosystem guidance.

    12 min
  • The Grand Quiz

    18 questions covering every lesson, with a scored result and grade.

    15 min