Functional programming
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions, emphasizing immutability and avoiding changing state. Rather than issuing commands that modify data in place—the imperative style—functional code builds new data structures through function composition.
Core ideas include pure functions (which always produce the same output for the same input), first-class functions (functions as values), and higher-order functions (functions that operate on other functions). These constraints make code more predictable, easier to test, and naturally suited to parallel computing.
Languages like Haskell, Lisp, and Scheme embrace functional principles fully, while others—JavaScript, Python, Clojure—blend functional and object-oriented styles. Concepts like recursion, lazy evaluation, and pattern matching are central tools.
Functional programming influences modern language design and has deep roots in lambda calculus, a formal system from mathematical logic.
Related
Declarative programming, Immutability, Function composition, Recursion, Type system, Category theory