# Functional Programming

> Code that hands back new values from small functions. Nothing changes in place.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** FP, Functional Style

## Think of it like

Think of it like a juice press. Put in apples, get out juice, and the press never changes.

## Definition

Functional programming builds programs out of small functions. Each takes inputs and gives back outputs. A function in this style does not change anything outside itself. Data is not edited in place; you make a new copy with the change. Functions can be passed around like any other value. Haskell is built on it, and JavaScript and Python let you use it.

## Example

Lucy turns a list of prices into prices with tax using map. The old list stays as it was, and a new list comes back.

## Why it matters

Code that changes nothing outside itself is easier to test. It is also safer when many things run at once.

## Common mistake

Thinking it means no state at all. Real programs still save files and show screens; the style keeps that work in a few places.

## Three principles

- **Small functions.** Inputs in, outputs out.
- **No changes in place.** Make a new copy instead.
- **Functions are values.** Pass them around freely.

## Related terms

- [Pure Function](https://learn.benibix.com/term/development/pure-function)
- [Immutability](https://learn.benibix.com/term/development/immutability)
- [Higher-Order Function](https://learn.benibix.com/term/development/higher-order-function)
- [Object-Oriented Programming (OOP)](https://learn.benibix.com/term/development/object-oriented-programming)
- [Haskell](https://learn.benibix.com/term/development/haskell)
- [Elixir](https://learn.benibix.com/term/development/elixir)

## Told apart from

- [OOP vs Functional Programming](https://learn.benibix.com/compare/oop-vs-functional-programming): Object-oriented code keeps data and actions together in objects. Those objects change over time. Functional code passes data through small functions. They make new values and change nothing.

---

Source: https://learn.benibix.com/term/development/functional-programming
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
