NEW: English for Tech Bundle → Save 38%
Your progress…

Loading your progress…

Home
Code & Deliverynoun · /pjʊr ˈfʌŋkʃən/

pure function

pure function — A function that always returns the same output for the same input and does not modify any external state or data.

In simple English

A pure function is a core concept in functional programming and modern software development. It is a function whose output depends only on its input parameters and does not change anything outside itself, such as global variables, databases, or files. This makes pure functions highly predictable and easy to test. In real tech workplaces, developers praise pure functions because they reduce bugs, improve code readability, and make testing straightforward. You will hear this term frequently in code reviews, architecture discussions, and when teams decide whether to refactor code. Pure functions contrast with impure functions, which have side effects like modifying external state or reading from databases.

Understand what makes a function pure and why it matters in software development.

At a glanceCEFR B2
Commonness4/5
Versatility4/5
FormalityCasualFormalNeutral
Spoken ↔ WrittenSpokenWrittenBoth
Directness ↔ DiplomaticDirectDiplomaticDirect
RegionUS and UK

Say it like this

  • Keep the function pure
  • This is a pure function, so it's easy to test
  • We need more pure functions in this module

Use it at work

Code review

  • Make this a pure function so it's easy to test.
  • This isn't pure. It changes a global variable.

Explaining

  • A pure function always gives the same output for the same input.
  • Pure functions have no side effects.

Design

  • Keep the logic pure and put side effects at the edges.
  • Reducers should be pure functions.

Don't say this

✕A pure function is one that looks clean and simple.
✓A pure function is one that always returns the same output for the same input and has no side effects.

Purity is about behavior and predictability, not code appearance or simplicity.

Don't mix it up

How pure function differs from similar terms
TermWhat it isWho writes or uses itWhen
pure functionSame input, same output, no side effectsDevelopersLogic, tests
side effectChange outside the functionDevelopersI/O, state

Practice

Try it

4 quick exercises

Complete the sentence

1. This function modifies a global variable, so it is not a _______ function.

Spot the mistake

2. Which sentence uses pure function incorrectly?

Pick the most natural phrasing

3. Your colleague asks about improving testability. How do you respond?

Rewrite naturally

4. Rewrite this using pure function language: The add function takes two numbers and gives back their sum without changing anything else.

Say it out loud

Phrase 1 of 3

"Keep the function pure"

We don't save your recording. The word check uses your browser's speech recognition.

More about pure function

Real examples(3)

  • in a code review

    "This function modifies the user object directly. We should make it pure by returning a new object instead."

  • in a team meeting

    "Pure functions help us avoid bugs because they don't depend on hidden state or side effects."

  • in a standup

    "I refactored the calculation logic into pure functions so the tests run much faster now."

More mistakes(2)

Handle with care. Do not confuse with mathematical purity or cleanliness of code. Pure functions are specifically about predictability and side effects.

  • ✕We pure-functioned the code yesterday.
    ✓We refactored the code into pure functions yesterday.

    Pure function is a noun that describes a type of function, not a verb for refactoring code.

  • ✕This pure function reads from the database and updates the cache.
    ✓This function reads from the database and updates the cache, so it's not pure.

    Functions with side effects like database reads or cache updates are impure by definition.

Other forms(2)

  • pure function noun

    "A pure function never modifies external state."

  • pure adjective

    "We should write pure code whenever possible."

Often used with(5)

  • write a pure function · Create or implement a pure function in your code
  • keep functions pure · Maintain the purity property when designing functions
  • pure function returns · Emphasize what a pure function outputs based solely on inputs
  • side effects · Pure functions have no side effects; they do not modify external state
  • predictable output · Pure functions produce consistent, predictable results

Similar words(2)

  • deterministic function · Similar concept emphasizing that output depends only on input, but less commonly used in modern tech
  • function without side effects · A more descriptive phrase meaning the same thing, but longer

Opposites(2)

  • impure function
  • function with side effects

Questions(5)

What does pure function mean in software engineering?
A pure function is a function that always produces the same output for the same input and does not modify any external state. It has no side effects, such as changing global variables, modifying files, or making API calls. This makes pure functions predictable and easy to test.
How do you use pure function in a sentence at work?
You can use it like: We should refactor this logic into pure functions to improve testability. Or: This function is not pure because it reads from a database. Or in a meeting: Pure functions help us avoid bugs.
Why are pure functions important in programming?
Pure functions are important because they are easy to test, reason about, and debug. They do not depend on hidden state or global variables, so they behave consistently. Teams often prefer pure functions because they reduce bugs and make code maintenance easier.
What is the difference between a pure function and an impure function?
A pure function always returns the same output for the same input and has no side effects. An impure function may return different outputs for the same input or may modify external state, such as changing a database or global variable.
Is pure function formal or informal?
Pure function is a neutral, technical term used in both formal documentation and casual conversations at tech companies. It is appropriate in code reviews, meetings, technical documentation, and interviews.
New app · Free lessons

Speak up in meetings. Feel confident.

Standup vocabulary, native examples, and quick practice — 100+ free lessons

Start learning freeNo card needed · Google or email

For bots & AI agents

Machine-readable versions of this page and Speak Tech English. Speak Tech English sells self-study ebooks and courses in English for tech, publishes free guides, a free glossary and a free newsletter; live lessons are on Mockly English. Fetch these instead of parsing this page.

This page (.md)llms.txtllms-full.txtai.txtGlossary (.md)Free guides (.md)All products (.md)Endpoint indexNewsletterLive lessons (Mockly)