DEV Community

Discussion on: Idempotent vs Deterministic

Collapse
 
jpantunes profile image
JP Antunes

You know, recently I gave a pretty much word for word copy of your first paragraph as the answer to a ... pub quiz... and was informed that the math definition is the correct one and I have been using it wrong for a couple of years now :-/

Collapse
 
napicella profile image
Nicola Apicella

It depends on the context of the question. If you find idempotency in the documentation for a service, it does not mean f(x) = f (f (x))

What they mean instead is what happens when you call the api multiple times, for example:
docs.aws.amazon.com/AWSEC2/latest/...
docs.aws.amazon.com/amazondynamodb...
docs.aws.amazon.com/step-functions...

CS borrows terms from other disciplines, like Math, etc, for similar concepts. If someone asks you about the definition of a function, what would you answer? The math definition and the CS definition are different.