Idempotence - Computer Science Meaning

Computer Science Meaning

See also: Referential transparency (computer science) and Reentrant (subroutine)

In computer science, the term idempotent is used more comprehensively to describe an operation that will produce the same results if executed once or multiple times. This may have a different meaning depending on the context in which it is applied. In the case of methods or subroutine calls with side effects, for instance, it means that the modified state remains the same after the first call. In functional programming, though, an idempotent function is one that has the property f(f(x)) = f(x) for any value x.

This is a very useful property in many situations, as it means that an operation can be repeated or retried as often as necessary without causing unintended effects. With non-idempotent operations, the algorithm may have to keep track of whether the operation was already performed or not.

Stronger is nullipotent, meaning that the results are the same if executed zero or multiple times, which is synonymous with "no side effects".

Read more about this topic:  Idempotence

Famous quotes containing the words computer, science and/or meaning:

    What, then, is the basic difference between today’s computer and an intelligent being? It is that the computer can be made to see but not to perceive. What matters here is not that the computer is without consciousness but that thus far it is incapable of the spontaneous grasp of pattern—a capacity essential to perception and intelligence.
    Rudolf Arnheim (b. 1904)

    Current illusion is that science has abolished all natural laws.
    Marshall McLuhan (1911–1980)

    Art is skill, that is the first meaning of the word.
    Eric Gill (1882–1940)