etrepum commented on how hash functions need to be idempotent. I pretty much always interpret things about functions and idempotence incorrectly.

When used in computing, saying a function is idempotent generally means you can call it a hozillion times and the state of the system (& thus the return value of the function) will be the same as if you called it once.

When used in mathematics, a function f is idempotent if f(f(x)) = f(x) for all x. The computing quality of idempotence isn’t useful since f(x) = f(x).

I would greatly appreciate it if we could all find a way to communicate that didn’t involve language.

When used in computing, saying a function is idempotent generally means you can call it a hozillion times and the state of the system (& thus the return value of the function) will be the same as if you called it once.

When used in mathematics, a function f is idempotent if f(f(x)) = f(x) for all x. The computing quality of idempotence isn’t useful since f(x) = f(x).

I would greatly appreciate it if we could all find a way to communicate that didn’t involve language.

Actually, idempotency in the computing sense is only meaningful where there ARE side effects.

For a couple of pythonic examples: “a[b] = c” where a is a list IS idempotent. But “a.pop()” is not.

Since the last thing you want from a hash function is to mutate its argument, the only meaningful sense for “idempotent hash function” is the mathematical one.

And etrepum is confused.

Alex is right that this is the same as the mathematical definition if you view the state of the world as implicitly passed to and returned from every function you call.

I do use idempotent in computing in the mathy way, but maybe that is because I’m a math student.

Then the property f(f(x)) = f(x) seems like a desirable one if equality is replaced by some equivalence relation

This is still weaker than invariance of f though…

From now on I’ll make it a point that “idempotent” DOES mean “f(f(x)) = f(x)”.

I did not realize that people were using it with this other, incorrect meaning.

f(x)=f(x) is invariant, or referentially transparent, or side-effect free, whatever. Real idempotence is a useful property to be able to name in computing.

Join me and embrace the joy of self-righteousness!

I guess my point is that the clarity of the terms depends on the domain that you are speaking in.