Paradigms in Programming

Short history of programming paradigms (draft)

paradigms-evolution

Control flow paradigms

Non-structured

Based on

Concepts

  • Binary code
  • Instruction
  • Memory
  • Processor
  • Register

Examples

  • ASM (1949)
  • Fortran I (1957)
  • BASIC (1964)

Structured

Based on

Concepts

  • Ban GOTO statements
  • Control flow statements (if, for, while...)
  • Code blocks
  • Modules
  • Flow Diagrams

Examples

  • Fortran II (1958)
  • Algol (1958)
  • All newer languages

Data flow paradigms

Procedural

If you think this paradigm is over, you're wrong. Some new languages, like Go are a newer breed of this Paradigm.

Based on

  • Engineering

Concepts

  • Module
  • Procedure
  • Scope

Examples

  • Algol (1958)
  • C (1972)
  • Go (2009)

Object-Oriented (OOP)

Became mainstream paradigm since 1990 by historical accidence. Simula was created at the time when people where obsessed with physical simulations. Parallels between real-world objects and their program representations were too tempted to avoid. Simula was created as an ancestor of Algol which already had Lexical scoping (closure) but people did not sight how it may be useful at that moment. C++ inherited Simula and Java became a "better C++" establishing OO approach as a standard of thinking for a long period.

Object-Oriented programming is Procedural in disguise, stuffed with bad ideas like local state, classes, inheritance, etc.

Based on

  • Engineering

Concepts

  • Coupling of Data and Behavior
  • Polymorphism
  • Inheritance
  • Incapsulation
  • Interfaces
  • Message passing

Points of interests

  • Abstractions
  • Dependencies
  • Patterns

Examples

  • Simula (1960)
  • C++ (1983)
  • Java (1995)
  • PHP (1995)

Older Functional

Concepts

  • Functional languages lacking some features (which were coined later) like enforced immutability.

Examples

  • LISP (1958)

Functional

Based on

Concepts

  • Currying
  • First class functions (functions can be passed to and returned from functions)
  • Immutable data (data is immutable by default)
  • Lambda functions
  • High order functions
  • Pure functions

Points of interest

  • Functional composition
  • Side effects
  • State

Examples

  • ML (1973)
  • Haskell (1990)

Logic

Based on

  • Math Logic

Concepts

  • Predicates (premises)
  • Constraints (relations)

Examples

  • Prolog

Object-Oriented + Functional

Concepts

  • Borrow ideas from Functional paradigm

Examples

  • Python (1991)
  • JavaScript (1995)
  • Ruby (1995)

Functional + Object-Oriented

Concepts

  • Functional languages which allow OOP

Examples

  • Scala (2004)
  • Clojure (2007)

Functional + Logic

Examples

  • Erlang

Time flow paradigms

More commonly applied to libraries than to languages.

Interactive

Reactive

Concepts

  • Promises, Tasks, Futures
  • Observer, Observable
  • Coroutines

Examples

  • RxJS