defining idempotent

2019-08-26

 | 

~2 min read

 | 

223 words

Idempotent is a word that gets thrown out a lot within computing but that I continually forget what it means.

A subject is considered idempotent if performing an action multiple times has no effect after the first time.

Definition

From Wordnik, the definition: 1

n. In multiple algebra, a quantity which multiplied into itself gives itself. Ordinary unity is idempotent. > adj. ( computing ) Describing an action which, when performed multiple times, has no further effect on its subject after the first time it is performed. adj. Said of an element of an algebraic structure (such as a group or semigroup ) with a binary operation : that when the element operates on itself, the result is equal to itself.

Examples

Examples helped solidify my understanding.2

In mathematics, an idempotent operation is one where f(f(x)) = f(x). For example, the abs() function is idempotent because abs(abs(x)) = abs(x) for all x.

Similarly deletion operations are idempotent because you can’t delete an item multiple times. For example:

target.delete(value)
target.delete(value)

The second delete call will not have any effect on the target since the value it’s trying to delete is not present to be acted upon.

Footnotes


Related Posts
  • http-fetch-patterns
  • RESTful APIs: Put Vs. Patch


  • Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!