|
Steve French posted:This is not quite what idempotent means. Idempotent functions can still have side effects, as long as the outcome is the same if called once or many times. "Set global variable foo to x" is idempotent; "add x to global variable foo" is not. In a reasonably designed code base, the global state will be something like "log this statement" or "write to the database" or "increment a counter" - something more abstract than a raw global and easier to reason about. But it's still important to remember that these constitute global state, even if they're not your classic global variables.
|
# ¿ Nov 29, 2015 23:07 |
|
|
# ¿ May 2, 2024 23:44 |
|
Steve French posted:To be honest I am not totally sure why this quoted my post; I wasn't making a comment about global state, really, just clarifying what idempotent means in that context. Continuing the general line of discussion with vague reference to what went before? I'm used to meandering email threads where someone quotes a random email that happened to be the tail end of the discussion.
|
# ¿ Nov 30, 2015 19:33 |