In functional programming you express truths, and in imperative programming you express steps.

Functional programming = haskell, scheme*, scala

  • A functional language (ideally) allows you to write a mathematical function, i.e. a function that takes n arguments and returns a value. A functional program always yields the same value for an input. Often recursive. Must be stateless, i.e. no operation can have side effects.

Imperative programming = java

  • A sequence of commands that the computer carries out in a sequence.

Object-oriented programming

  • These instructions, and the data they manipulate, are organized into objects

Procedural programming = C, Go, Fortran.

  • Procedures (aka subroutines or functions) contain a series of computational steps to be carried out. A procedural routine is not guaranteed to yield the same value for an input. Routines have side effects, i.e. change and maintain state.