3 ms·
As always, the problem can at least be made easier by using the right data structure. Counting time as just "seconds since epoch" is like, really convenient, a
by saalweachter 5y ago
As always, the problem can at least be made easier by using the right data structure.
Counting time as just "seconds since epoch" is like, really convenient, and by convenient I mean lazy. It may have even been excusable when computers had kilobytes of RAM and if they had hard disks at all, it wasn't more than a megabyte. When "assembly" was high-level programming.
But now that we have infinite disk, processors that are idling most of the time they aren't rendering 3d video, and programming languages which almost don't suck, we could stand to use richer representations of dates that include the semantic concepts people use when talking about time, like "years" and "days" and "hours". You don't need to know how many leap seconds -- or even leap days -- are between 2021-07-01 and 2022-07-02 to say that one is a year and a day after the other.
There was a time and a place for "GOTO"s; there still is, just much less often than back when that was your only real option for flow control. Likewise, the time for storing dates and times as seconds since Jan 1 1970 was much closer to that date than today.