Programming paradigm

Programming paradigms are a way to classify programming languages based on their features.

Imperative programming

Uses statements to change the program's state.

Declarative programming

Expresses the logic of a computation without describing its control flow.

  • functional programming - the desired result is declared as the value of a series of function applications
  • logic programming - the desired result is declared as the answer to a question about a system of facts and rules
  • mathematical programming - the desired result is declared as the solution of an optimization problem

Some languages are heavily slanted toward one paradigm — C is procedural, Java/C++ are almost entirely class oriented, and Haskell is functional. But many languages also support code patterns that can come from, and even mix and match from, different paradigms. So called "multi-paradigm languages" offer ultimate flexibility. JavaScript is a multi-paradigm language.

Resources