Programming Paradigms - What I like in Functional Programing?



Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.
Some paradigms are concerned mainly with implications for the execution model of the language, such as allowing side effects, or whether the sequence of operations is defined by the execution model. Other paradigms are concerned mainly with the way that code is organized, such as grouping a code into units along with the state that is modified by the code. Yet others are concerned mainly with the style of syntax and grammar.
Common programming paradigms include:
  • imperative in which the programmer instructs the machine how to change its state,
    • procedural which groups instructions into procedures,
    • object-oriented which groups instructions together with the part of the state they operate on,
  • declarative in which the programmer merely declares properties of the desired result, but not how to compute it
    • functional in which the desired result is declared as the value of a series of function applications,
    • logic in which the desired result is declared as the answer to a question about a system of facts and rules,
    • mathematical in which the desired result is declared as the solution of an optimization problem

Functional programming languages are specially designed to handle symbolic computation and list processing applications. Functional programming is based on mathematical functions. Some of the popular functional programming languages include: Lisp, Python, Erlang, Haskell, Clojure, etc.
Functional programming languages are categorized into two groups, i.e. −
  • Pure Functional Languages − These types of functional languages support only the functional paradigms. For example − Haskell.
  • Impure Functional Languages − These types of functional languages support the functional paradigms and imperative style programming. For example − LISP.