4 ms·
It's not idempotent - the same source URL entered multiple times yields different shortened URLs. Not sure if that's a feature or a bug ...
by pards 4y ago
It's not idempotent - the same source URL entered multiple times yields different shortened URLs. Not sure if that's a feature or a bug ...
- WalterGR 4y agoToday I learned the mathy definition of idempotent (used above) which is different than the one more commonly used when talking about code: https://en.m.wikipedia.org/wiki/Idempotence https://en.m.wikipedia.org/wiki/Idempotence
- Infernal 4y agoIt’s not clear to me what the difference in definition is - even reading the CS definition on Wikipedia, both cases reference the mathematical definition. What am I missing?
- moeris 4y agoIn the imperative sense of idempotent, a method is idempotent with respect to system state, not just its arguments. It's about repeated calls e.g. a.f(x).f(x) results in the same state as a.f(x) Not about repeated application. E.g. f(f(x)) = f(x)
- cobbal 4y agoRight. If you think about it as a function of the state itself, the 2 definitions agree. If the function is `f(x, state) -> (y, state')`, then f is "imperitively idempotent" when `g(state) = f(fixedX, state).state'` is "mathematically idempotent"
- nicoburns 4y agoFrom 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 4y 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 4y 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]
- that_guy_iain 4y agoSeems like a feature since it says try again when you create a link.
- papandada 4y agoNot deterministic then
- MontyCarloHall 4y agoThat just means it’s not a well-defined function (i.e. each input is mapped to only one unique output, which is not the case here). As other posters write, “idempotent” means that recursively applying the function returns the same result, e.g. f(f(x)) = f(x). (The site is also indeed not idempotent, since entering a shady URL will not return the same shady URL.)
- texaslonghorn5 4y agoIn particular, it's not well-defined because it's nondeterministic/randomized. Coincidentally I like your username.
- cwmoore 4y agoSince I typically find short urls suspicious and frightening, especially in text messages from short phone numbers not in my contacts, this headline illustrates a third form of idempotentcy.