Functional Programming
A programming paradigm treating computation as evaluation of mathematical functions.
Also: FP
Definition
Functional programming (FP) is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing state or mutable data. Core concepts include pure functions (same input always produces same output, no side effects), immutability, higher-order functions (functions that take or return other functions), and function composition. FP improves testability, concurrency safety, and reasoning about code. Languages like Haskell are purely functional; JavaScript, Python, and Scala support functional styles alongside other paradigms.
Example
“Using functional programming in JavaScript, a developer uses map, filter, and reduce instead of loops to transform a list of user objects into a summary of active users' total spending without mutating the original data.”
Synonyms
- FP
- declarative programming
- pure function programming
Antonyms / Opposites
- imperative programming
- object-oriented programming
- procedural programming
Images
CC-licensed · free to useVideo
Related Terms
- object-oriented-programming
- design-pattern
- recursion
- unit-testing
