4 ms·
Or maybe we just need to code system that handles leap seconds correctly.
by hartator 10y ago
Or maybe we just need to code system that handles leap seconds correctly.
- whyileft 10y agoOr maybe we should start holding project managers accountable for these issues instead of simply basing their performance on deadlines.
- admax88q 10y agoClassic Hacker News, it's always the PM or the management at fault, engineers are faultless.
- na85 10y agoI'd have time to develop a new toy programming language as a service alongside 3 new JavaScript frameworks in 2017 if it weren't for the evil PMs.
- whyileft 10y ago> if you can’t measure it, you can’t manage it.
- craigvn 10y ago;-) 98% of developers would be clueless to leap second issues. Hell, 50% struggle with leap years.
- lend000 10y agoTwo valid points. A third: convince everyone to adopt epoch time for data transfer (seconds since epoch), and let applications that require formatted time do the transformation where it will be used (not earlier). It doesn't make a lot of sense that a timestamp represented as HOUR/MIN/SEC:DAY/YEAR should be passed around on the network of a production system. Leave it to the recipient to convert. I guess this is a subset of your point.
- swiley 10y agoI wrote a WebDAV client the other year and dates where one of the hardest parts to implement because they expected them in calendar format! It seemed so odd to me that they would do that.
- stephenr 10y agoHttp/1.* headers are intended to be human readable
- rspeer 10y agoLeap seconds aren't just an issue of formatting times. Leap seconds actually involve turning the UTC count of seconds back by a second. You'd have to switch the "seconds since epoch" count to TAI, and that would cause new formatting bugs because all kinds of software assumes that the minute changes on a multiple of 60 seconds since the epoch.
- lend000 10y agoYes but even here, seconds since Epoch should remain unaltered, and the correction should be made by whatever is rendering a human readable date format (to address every leap second). In most cases, the renderer wouldn't have to address it (since it's only being read by humans, and a second difference does not usually matter) and it's truly a non-issue! The application-layer dev can choose to increment time in whatever blocks he wants instead of having an if-else chain for every "official" leap second. Like adding a minute every few hundred years, to that other commenter's point.
- samrolken 10y agoUnfortunately, epoch time is not literally "seconds since epoch", at least not as implemented/standardized as "Unix time". It skips or repeats itself in case of leap seconds. So it can't save us here. I think if there were such a thing as a different kind of epoch time that literally actually is "seconds since epoch" it would help a lot and work like you suggest.
- alexbecker 10y agoMaybe we should code systems with zero bugs. /s
- wyager 10y agoWell, yeah, that's not a bad idea. It was kind of Dijkstra's whole thing. The problem is that, at current levels of technology, it's economically better to write cheap buggy software than more expensive bug-free software for almost all consumer applications. We are gradually pushing the optimality curve towards the provably bug-free end of the spectrum, but it will take time.
- recursive 10y agoI thought we were pushing the optimality curve toward ever greater volumes of ever buggier code.
- nullc 10y agoI believe those efforts could be better spent making systems more robust against other threats that can't be avoided by simply deciding to stop cutting ourselves. Besides: Even expensive commercial time keeping devices frequently mishandle leap seconds. History suggests that we are underestimating how difficult they are to get right in complex systems.
- guscost 10y agoSomeday when everyone switches to Rust we can have a standard library that handles all of this and software bugs will be obsolete ;)
- mark-r 10y agoIt's difficult to write bug-free code for events that happen very infrequently. Even more so when the distributed nature of the system makes effective testing under real-world conditions nearly impossible.
- greglindahl 10y agoYeah, that's exactly why Leap Day getting skipped every 4th year is such a disaster.
- macintux 10y agoThe ratio of embedded systems that care about the calendar to those that care about time has to be astronomical.
- Fnoord 10y agoGlad TOTP refresh every 30 seconds, and are generally valid for at least 1 minute. One second less wouldn't make a large difference.
- Fnoord 10y agoGlad TOTP refresh every 30 seconds, and are generally valid for at least 1 minute. One second less wouldn't make a large difference.