</>CodexBash
All articles
Programming

Functional programming basics

The core ideas of functional programming explained with JavaScript, Python and Java examples: pure functions and side effects, immutability, functions as values, map, filter and reduce, composition, closures, currying and partial application, declarative style, and how to use these ideas in everyday code.

CodexBash, , 6 min read

Functional programming (FP) is a style of programming built around functions that take inputs and return outputs, without changing anything else along the way. Languages such as Haskell, Clojure, Elixir and F# are built around it, but its ideas have spread everywhere: JavaScript's array methods, Java streams and lambdas, Python comprehensions, React's components and hooks. You do not need a functional language to benefit. This article explains the core ideas with examples in languages you probably already use, and shows how they make everyday code easier to test and reason about.

Sign in to read the rest

The whole 6 minute article is free with an account, along with every problem, lesson and tutorial. No card.