3 ms·
From your link: > the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result
by nicoburns 5y ago
From your link:
> the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application
Perhaps my maths background is influencing me here, but isn't that the commonly used definition when talking about code?
- pedrovhb 5y agoNot the replied-to user, but I also wasn't aware of the mathematical definition and my understanding of idempotency was that the main point was that performing the same idempotent operation multiple times wouldn't make a difference in terms of __side effects__ (for instance, not charging a user twice when accidentally submitting an idempotent request twice).
- WalterGR 4y agoYep, this is the meaning I was referring to.
- morsch 5y agoThe function f is idempotent, if f(x) = f(f(x)). For this URL shortener, if http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov (from above) points to http://shadyurl.com/ http://shadyurl.com/, then shortening http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov should also return http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov http://www.5z8.info/super-nsfw_g0v1ba_hot-older-goats.mov. It's not enough for it to always return the same URL for the same input (which it also doesn't appear to do).
- deleted 4y ago[deleted]