4 ms·
Clearly this should stay a string. But I suspect they’re converting to an int to compare which definition is newer.
by jonny_eh 5y ago
Clearly this should stay a string. But I suspect they’re converting to an int to compare which definition is newer.
- turminal 5y agoThat would work just fine with a string comparison.
- priansh 5y agoYeah my first thought was, well you could lay out the timestamp in a way that supports lexicographical sorting, and then realized they had already done so. No reason this shouldn’t be a string!
- petee 5y agoIt can be both. DNS serial numbers are YYYYMMDDnn, and it works just fine for humans, it is easy to convert, more compact, and you can compare in a single operation. Internally, there is no reason for it to be a string.
- genocidicbunny 5y agoComparing with strings ain't no panacea either. There's some suspicion that Windows 9 was skipped because a lot of old software checked for Windows 95 or 98 by just doing a string compare against "Windows 9". (For the record, I kind of doubt this was much of a concern by the time Windows '9' was being worked on, but there's a certain logic to it.)