Idempotence

Idempotence, or idempotent, illustrated with an idempotent action of look_at_cake that always has the same effect, compared with a non-idempotent action of eat_slice_of_cake

👇 Get new sketches each week

Idempotence is essentially an operation that, no matter how many times you do it, you’ll still get the same result, at least without doing other operations in between. A classic example would be view_your_bank_balance being idempotent, and withdraw_1000 not being idempotent. It’s a property that’s often handy as you can retry the operation without worrying about unintended effects.

Idempotence is a concept from mathematics and computer science but can be applied more generally. For example, simple on and off buttons are idempotent, a property that can be very useful in emergencies.

Published
Buy Me A Coffee