Software engineer Noah Sussman writes about testing, software as narrative, and the 'Falsehoods programmers believe about time' essay.
HN commenters repeatedly link the classic 'Falsehoods programmers believe about time' post and its follow-up whenever time handling comes up.
Examples of essential complexity you have to worry about if you want your code to be correct, and even if you want to test/detect all issues that can/do come up:
- https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
- https://infiniteundo.com/post/25509354022/more-falsehoods-programmers-believe-about-time
In my experience engineers will often brush these sorts of things off as “edge cases”, but really all of these complexities are just how dates and time work in the real life (I’d argue that they’re just “normal cases” to test for)… So any anomaly in software will cause real problems of varying importance for users.
> It makes me angry that programmers feel that they "own" the concept of time measurement
Programmers feel that they "own" pretty much every social construct, by virtue of the fact that it is their job to encode those constructs into interfaces and databases. See the famous "falsehoods programmers believe about X" [1] --- and I'm sure you'll like this one about time [2].
[1] https://github.com/kdeldycke/awesome-falsehood
[2] https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
Past bikeshedding, there's also the long list of myths programmers believe about time[1] and the crowd-sourced followup[2]. Pendulum inherits from datetime in the stdlib, but I'm unsure how well either of those address the issues raised (or even if it's possible - some need to be addressed by the code that uses pendulum/datetime).
[1] http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
[2] http://infiniteundo.com/post/25509354022/more-falsehoods-programmers-believe-about-time
I love the "Falsehoods programmers believe about X" articles. They are basically ready-made failure test cases. Whenever a junior co-worker would say something like "I know! I'll just write our own date and time handling code." I'd point him at [1], let him stew on that for an hour or so, and then, sure enough, go back and lo and behold he's convinced to just use a ready-made third party library instead.
1: http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
ho boy, before I break out "falsehoods programmers believe about time,"[0] nobody wants to manually have to rewrite the UTC time something's supposed to run at when the business hours keep changing relative to UTC for (at the most basic) Daylight Savings reasons.
[0] https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
(if this is your first time seeing this article, have fun! also check out the one about names.)
https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time
I'm very thankful for the creators of https://www.worldtimebuddy.com/ handling time zone weirdness, etc, so that I can still get to Zoom calls on time (usually). I don't know how the Moment developers can ever think it's "done" - "We now generally consider Moment to be a legacy project in maintenance mode. It is not dead, but it is indeed done."