Re:You know how HTTP GET requests are meant to be idempotent?
by icebraining on Tuesday May 01, 2018 @08:04AM
(#16966301)
Having no side-effects means it doesn't cause side-effects, not that it can't be "victim" to them. It's no the same as purity.
Given that HTTP requests are supposed to trigger database reads that may return a different result after some time, then “side effect free” would indeed be incorrect.
The litmus test is ... does it always return the same output given the same input? If that can change, the it’s not describing a pure function, but a side effectful one.
And the output of a GET request can and does change.
Speaking of which people here aren’t talking of idempotency in a mathematical sense:
f(f(x)) == f(x)
If you really think about it, GET requests aren’t even idempotent ;-)