2 Matching Annotations
 Apr 2020

blog.jessitron.com blog.jessitron.com

In math, idempotence describes only unary functions that you can call on their own output. Mathidempotence is, “If you take the absolute value of a number, and then you take the absolute value of that, the result doesn’t change on the second (or subsequent) operations.” Math.abs is mathidempotent. Mathidempotence only applies to functions of one parameter where the parameter type and return type are the same. Not so useful in programming.

Programmingidempotence is about side effects. It’s about stuff that happens to the outside world when you call a function. Idempotence says “If you’ve called me once, it doesn’t matter whether you called me again.”
