3 ms·
Agree, but people often miss that there's two different use cases here, with different requirements. "2 days from now" could either mean "after 2*86400 seconds
by growse 2y ago
Agree, but people often miss that there's two different use cases here, with different requirements.
"2 days from now" could either mean "after 2*86400 seconds have ticked" or it could mean "when the wall clock looks like it does now, after 2 sunset events". These are not the same thing.
The intent of the thing demanding a future event matters. So you can have the right software abstractions all you like and people will still use the wrong thing.
The problem is that programmers are human, and humans don't reason in monotonic counters :)
- PaulDavisThe1st 2y agoOne might also recall the late Gregory Bateson's reiteration that "number and quantity are not the same thing - you can have 5 oranges but you can never have 5 gallons of water" [0] Seconds are numbers; calendrical units are quantities. [0] Bateson was, in some ways, anticipating the divide between the digital and analog worlds.
- AnthonyMouse 2y ago> "2 days from now" could either mean "after 2*86400 seconds have ticked" or it could mean "when the wall clock looks like it does now, after 2 sunset events". These are not the same thing. Which is why you need some means to specify which one you want from the library that converts from the monotonic counter to calendar dates. Anyone who tries to address the distinction by molesting the monotonic counter is doing it wrong.