Falsehoods Programmers Believe About Time (2012)
Many, if not most of these things are problems with the environment, not things programmers should think about or try to solve. In fact, most of them should explicitly not be thought about. All that that will do is lead to defensive programming - What if X happens? What if Y? The answer to most of them is simple - Crash. Make it loud and clear that something is wrong. Any attempts to rectify the problem, and most attempts to even detect it will only add surface area to the code, surface area where you can screw up and introduce bugs.<p>Could the system&#x27;s timezone change? Yes. If you&#x27;re manipulating time sanely, you&#x27;re already using a timezone aware time class - particularly when serializing - and that&#x27;s great. But if you&#x27;re uncertain, it&#x27;s best not to try to rectify. Your program will never be able to guess with any success.<p>Almost all of this post strikes me as along the vein of the questions of Babbage - &quot;Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?&quot; Almost all of these are the wrong numbers. Rather than leading you to the simple, correct solution (Use good serialization formats and timezone aware datastructures) it leads you down a path of paranoia, convinced the world is out to get you. If you&#x27;re programming for that world, you&#x27;re either a DRM programmer and should burn in hell, or you&#x27;re doing it wrong. Trust your environment and OS and make damn sure that when you&#x27;re setting up those layers you set them up right - Don&#x27;t worry that every second open() call will return an invalid filehandle, just because.