6 ms·
Lexicographic sorting does not work for numbers of different lengths, e.g. "100" and "9".
by jeff-davis 6y ago
Lexicographic sorting does not work for numbers of different lengths, e.g. "100" and "9".
- pwg 6y agoIt does if you zero fill the shorter number to an equal number of digits: "100", "009".
- koolba 6y agoThere's a special place in hell for people that using variable length representations for time units that are meant to be consumed by machines. I think it's across the hall from the room for people who configure servers for anything besides UTC.
- JdeBP 6y agoIs their punishment to be forced to parse "009" with the C language's strtoul() library function for all eternity? (-:
- boring_twenties 6y agoWhat's the problem with strtoul? Just make sure to pass 10 as the third parameter, not 0.
- mywittyname 6y agoMaybe the punishment in hell should be to RTFM for the rest of eternity.
- boring_twenties 6y agoSorry, what? It's not like it's a default parameter, you would have to explicitly pass zero if you want the "guess base based on prefix" behavior.
- Leherenn 6y agoError handling is pretty horrible. And also it happily accepts negative values.
- btilly 6y agoWhere do you put the people who think that we should inflict leap seconds on UTC?
- koolba 6y agoIn a special room resting atop a centrifuge so they can spend eternity arguing with each other about how long they've been in there.
- wiml 6y agoUTC has leap seconds by definition. Conventional POSIXish epoch time is a little more complicated – typically, the length of a second varies.
- btilly 6y agoI am fully aware. I also don't believe that when everything was adopted, that people realized how big a deal it would become for software, and systems driven by software. Every leap second, factories shut down. Just in case. Every leap second we face the possibility of a large chunk of the Internet going dark like happened in 2012. Computer programmers spend millions of dollars per year in aggregate dealing with the possibility of leap seconds. All for something that, over thousands of years, won't lead to as big a discrepancy between the Sun and the clock as what we voluntarily do 2x per year for daylight savings time. Does it make any sense to continue this insanity? Why?
- dragonwriter 6y ago> Computer programmers spend millions of dollars per year in aggregate dealing with the possibility of leap seconds. Millions of dollars in aggregate per year? Assuming that’s just the US, with ~4 million working programmers with a median pay of ~$86,000/yr or about $43/hr assuming about 2,000 working hours per year, that’s, if I’m not messing up the math, on the rough order of 1 minute per programmer per year, on the order of a couple hours per programmer per year if you bumped it to hundreds of millions. In either case, its a neglible share of programmer-hours.
- 6y ago
- sixothree 6y agoOn Windows Explorer it does. Not sure why other systems and apps have not adopted this.
- account42 6y agoThey have. There are even different variants of human/version sort. They are of course not as straight forward as a simple lexicographical sort so not everything is going to implement one.