4 ms·
Version Numbering bothers me. Mathematically 1.2 is greater than 1.18. Yet in versions it is lesser. I find this annoying and counter intuitive.
by snarkerson 5y ago
Version Numbering bothers me.
Mathematically 1.2 is greater than 1.18. Yet in versions it is lesser.
I find this annoying and counter intuitive.
- sinsterizme 5y agoYeah I always get tripped up. I feel like we should write it as 1.02, that way it can get up to 1.99 without this issue :)
- titzer 5y agoMe too. For Virgil, because I am a fan of the roman poet, I am using roman numerals for the major versions and append a monotonically-increasing-regardless-of-major-version "00XXX" build number to that. This ensures they always sort lexicographically. ...until I get to version IX, i.e. 9, which would sort incorrectly. So I'll just skip 9, 19, 29...90...heh. :)
- chrismorgan 5y agoIf your algorithm is “choose the next number for which its Roman numeral sorts lexicographically higher than the current number”, then if you start at 1 you will only get 35 elements, since 38 (XXXVIII) is the lexicographically-highest Roman numeral. Using this precise rule, the starting point that gets you furthest is 250, which grants you 153 elements before stopping at 1038 (MXXXVIII). It’s possible to devise a longer sequence by skipping some numbers (e.g. after 1000 you’d jump to 1100), but I’m too lazy to calculate how you’d do all that. All this also assumes subtraction rules, which were a late addition to Roman numerals; without subtraction rules, four is written IIII instead of IV, and nine VIIII instead of IX, and so all of 1–49 would be lexicographically sorted. from docutils.utils.roman import toRoman def sequence(start): last = '' out = [] for i in range(start, 5000): this = toRoman(i) if this > last: last = this out.append(i) return out # Brute force way because I’m lazy; takes around ten seconds on my machine. start, s = max(((start, sequence(start)) for start in range(1, 5000)), key=lambda x: len(x[1])) print(f'{start} gives you {len(s)} items, {s}')
- usrusr 5y agoI find it not quite as unintuitive when there are more than two fields: 1.2.0 is almost impossible to be misread as greater than 1.18.0.
- philliphaydon 5y agoOMG I didn't even realise, I was looking at the graphs getting so confused.
- twhb 5y agoInteresting how somebody can be tripped up by 1.2 vs 1.18 yet not tripped up by 1/2 vs 1/18. It could just take time, but I think there’s also a factor of feeling that dates are worth learning while version numbers don’t deserve direct attention and instead should be a subset of a nearby concept that does.
- amscanne 5y agoIf it helps, a version is simply not a decimal number and the dot is not a decimal point. It’s just a separator. The dot often used for purposes other than a decimal point (a few times in this comment!).
- 1_player 5y agoThe worst thing is when laymen abbreviate the version number 1.20 to 1.2 - quite confusing. Versions aren't numbers.
- pdpi 5y agoVersion numbers are effectively base infinity, not base 10. Periods are digit separators, and each digit is written in decimal. The usual representation for IP addresses is basically the same (four base-256 digits separated by periods)
- theshrike79 5y agoYou can think of them like 1.2.0 and 1.18.0 if that makes your life easier. That way your brain can't think of them as numbers any more =)