Pure function
Meaning in software engineering, with examples
In software engineering, pure function means: A function that returns the same result for the same inputs and has no observable effects outside its calculation.
In Turkish: saf işlev
How it is used
Used in functional programming and test design. Reading changing external state can prevent a function from being pure.
Example sentences
The tax formatter is a pure function because its output depends only on its arguments.
The example assumes formatting changes no external state and reads no changing settings.
We moved file writing outside the pure function that calculates the report totals.
Separating the write keeps the calculation independent of an observable storage effect.
Common collocations
- write a pure function
- pure function composition
Related terms
More terms: Programming Concepts
Practise with graded reading
Reading at the right level is the fastest way to make new words stick. Pick free English books by level:
