Revision [723]
Last edited on 2010-06-02 16:16:52 by AdminSkyld [Added wikipedia link to Related section]Additions:
Function purity is a programming concept which explores the side-effects of a given function.
A "pure" function is one that takes some input and returns some output without having any side effects (essentially, the state of the script should be exactly the same after running the function). For example:
An "impure" function, on the other hand, is one that may give a different output on the same input, or has side effects which affect other areas of the script after the function has been run, e.g.
==Related==
The following related articles are recommended:
- [[Wikipedia:Pure_function Pure Function]] (on Wikipedia), which explains further the idea of function purity.
A "pure" function is one that takes some input and returns some output without having any side effects (essentially, the state of the script should be exactly the same after running the function). For example:
An "impure" function, on the other hand, is one that may give a different output on the same input, or has side effects which affect other areas of the script after the function has been run, e.g.
==Related==
The following related articles are recommended:
- [[Wikipedia:Pure_function Pure Function]] (on Wikipedia), which explains further the idea of function purity.
Deletions:
An "impure" function is one that may give a different output on the same input, or has side effects, e.g.