A programming paradigm is a way to classify programming languages.


Paradigms

  • Imperative
    • procedural
    • object-oriented
  • Declarative
    • functional
    • logic
    • reactive

Imperative programming

This paradigm involves commands for the computer to perform actions. It focuses on describing how a program operates.

  • procedural: relies on a sequence of steps to solve a problem (C, Pascal, and FORTRAN)
  • object-oriented: uses ‘objects’ (instances of classes) which are organized around data and behavior. (Python, Java, and C++)

Declarative programming

This paradigm expresses the logic of a computation without describing its control flow. It focuses on what the program should accomplish.

  • functional: programs are executed by evaluating expressions, avoiding changing-state and mutable data. This paradigm emphasizes the application of functions, in contrast to the procedural programming style, which emphasizes changes in state(Haskell, Lisp, and Erlang)
  • logic: a set of logical statements (system of facts and rules), and the execution engine will try to make these statements true in which this process could possibly derive new facts (Prolog)
  • reactive: allows for efficient execution of parallel tasks and manages back-pressure (when the system is over-stressed with requests). Good for non-blocking, event-driven apps (ReactJS, RXJava, and Akka)

Please note that these paradigms are not mutually exclusive. Many modern programming languages support multiple paradigms