News for hackers. Stuff that matters.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by djrogers on Saturday January 01, 2022 @11:50AM (#29760150)
> Seriously, if you can’t add, subtract, multiply, and divide them, then they aren‘t numbers

You’ve missed a ton of other scenarios here, the relevant one being a compare operation with a < or > output. These are version numbers. Version numbers the way they’re used here increment, they are not random strings, which is what you’re effectively suggesting.

If the version numbers here were represented as strings they’d need to be converted to a number at some point to compare them, and you’d probably run into the same problem you have here.

Of course I’m sure you’d have the perfect, completely applicable, and universally accepted solution then as well…

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @11:58AM (#29760229)
> Version numbers

They still aren't compatible with number types. They are groupings of numbers at best.

2.9 is an earlier (not less than) version than 2.10.

3.1.6 isn't a (strict) numerical format.

5.4.11-beta1 has non-numerics.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by DSMan195276 on Saturday January 01, 2022 @12:57PM (#29760837)
Ignoring the tags (which not everything uses) it's possible to express all of those as a single increasing number by simply putting enough zeros in, which does make them representable as simple numbers, so I think you're kinda splitting hairs. Most version number representations/libraries will likely do something similar to read it anyway even if you keep it a string - split it into separate individual numbers and compare major/minor/patch/etc separately, and by virtue of fitting the individual parts into separate integers you're giving them all a maximum value, which is what the zeros would do.

The problem is they shoved the individual parts into a single 32-bit integer, which just isn't enough space so they had to compromise and make some of the numbers have extremely small ranges.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @01:15PM (#29760991)
There are exceptions to that rule, however - Maintenance releases. Node, Typescript, Java, .NET, and I'm sure many more obvious instances I need not list.

If you "just" increment you leave no room for showing patching in your versioning strategy.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by DSMan195276 on Saturday January 01, 2022 @01:38PM (#29761207)
I'm not entirely sure what you're getting at? That's the point of the `feature` and `patch` version numbers. If you want you can put a 4th or 5th number in there as well to fit whatever uses you have.

Perhaps you're missing what I meant by 'increasing' - it's just a 1:1 conversion of the version number to a single integer, it's not like you're assigning every version a new number. 3.9.3 would become something like 3009003, and 3.10.1 would become 3010001. If you compare those representations then 3010001 always compares higher, and there's also nothing preventing you from releasing 3.9.3 after 3.10.1.

My point was that doing a format like the above (major, 3 digit minor, 3 digit patch) is not fundamentally different from storing each individual number as it's own integer, which most version libraries I've seen do at some point. The problem is just that the range of each number is restricted significantly by requiring 3 digits rather than if you used individual 32-bit or 16-bit integers for each one.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @02:34PM (#29761807)
We agree. :)

A "Version Number" is not just a "Number", as I said right at the start.

Just to clarify, having an integral incrementing number as the whole version number strategy explicitly prohibits the use of major/minor/patch.

Unless you intend on using 0s (instead of fullstops) as delimiters I suppose.

Edit: as you demonstrate in your post. I'll stop posting now :)

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tuwtuwtuwtuw on Saturday January 01, 2022 @12:19PM (#29760439)
If you define your version numbers to be numbers, then your version numbers will be numbers. I really don't get the confusion over this.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @12:25PM (#29760496)
The assumptions/traits/expectations that come with numbers (and most importantly, that are embedded into the number _types_) may not be consistent with _version number_ types.
[dead]
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @12:30PM (#29760560)
I think you need to read the thread again. The point (there is just one) I've made in both replies has been very clear and direct.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Spivak on Saturday January 01, 2022 @01:01PM (#29760872)
I mean if your standard for “numbers” is “can be mapped 1-1 to integers” then everything is a number. The operations you actually do to numbers have to have meaning in the space you’re defining.

Does “1.2.0” + “2.3.0” make sense in your world?

And if you’re like what about ordering and comparisons, then sure, you have a partially ordered set.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Robin_Message on Saturday January 01, 2022 @04:02PM (#29762744)
Dates can be very meaningfully and sensibly converted to/from a numeric representation, yet the addition of two dates doesn't make sense, so I don't think not bring able to add versions holds.

And not everything can be mapped 1-1 with the integers; reals for example, and therefore arbitrary strings. (Of course, that's only theoretically; with a limited string length you can obviously manage)

You're right that the ordering is the key feature of a version representation; munging it into an integer gives you that for free but risks getting to overflow quite easily (as in this case). I guess the conclusion is, use a language like Rust or Ruby when you can define ordering easily on structured data.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tuwtuwtuwtuw on Saturday January 01, 2022 @01:07PM (#29760924)
I don't get what you're trying to add. If Microsoft defined their version numbers as an integer then it's an integer value. They didn't define it as say "1.2.0" so not sure what that has to do with anything.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tomjakubowski on Sunday January 02, 2022 @07:42PM (#29775916)
somebody better tell Cantor...
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by nottorp on Sunday January 02, 2022 @07:09AM (#29768085)
Google is forcing all Android applications to have both a version name, which is an arbitrary string that's only used for displaying to the user, and a version code, which is a plain integer and is what is used to decide which is the latest version that will be installed.

That should fix a lot of version number problems (prolly not all) and i've been stealing the idea for my own versioning lately.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by marcellus23 on Saturday January 01, 2022 @12:56PM (#29760827)
Did you read the link that we’re all discussing here? The versioning scheme they use is not any of those formats.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by detaro on Saturday January 01, 2022 @12:37PM (#29760630)
The reference was

> Version numbers the way they’re used here

And none of that applies to them. Yes, there are versioning schemes that work differently, irrelevant to the example here.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by rat9988 on Saturday January 01, 2022 @12:32PM (#29760578)
> 2.9 is an earlier (not less than) version than 2.10.

Not necessarily. Some projects go from 2.9 to 3. I'm not sure what you are trying to prove.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by solarengineer on Saturday January 01, 2022 @12:50PM (#29760765)
For software version numbering, I consider 2.9 to have been released "earlier than" 3 (and not lesser than 3).
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Spivak on Saturday January 01, 2022 @01:05PM (#29760908)
How do you deal with a project like Ansible where 2.9.16 was released after 2.10.0 or Python 2.7.18 was after 3.0.4?

I think version numbers are a partial ordering at best.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by rat9988 on Saturday January 01, 2022 @03:05PM (#29762108)
They aren't numbers, easy.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jenk on Saturday January 01, 2022 @12:41PM (#29760666)
> They still aren't compatible with number types.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by rat9988 on Saturday January 01, 2022 @03:04PM (#29762095)
Why?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pigbearpig on Saturday January 01, 2022 @12:28PM (#29760537)
These should have been strings, end of story. You can sort a string. Amazing to see storing a non-number as as number being defended. Truly CS101.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by DSMan195276 on Saturday January 01, 2022 @01:39PM (#29761226)
You can certainly sort a string, but I think there are valid reasons to avoid it if possible. What they shouldn't be doing is trying to shove it into a single 32-bit integer - if they parsed it into separate integers for each of the individual parts (like a simple date representation would do) then the issue would go away. Whether it's worth that extra work to avoid the string comparison is debatable, but if they go on to mask out parts of the version number and look at them individually (Ex. Only the year, or only the revision number) than it would probably be worth it to just do all the parsing upfront and avoid any messing with strings after that.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by srj on Saturday January 01, 2022 @01:54PM (#29761373)
I guess it depends on the language but using a string for this doesn't seem like a great choice except for user display / logging. Given this is a version number you'd want to support comparison operators, and a struct with those operators defined (and a string format method) would make more sense imo.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mr_toad on Saturday January 01, 2022 @09:46PM (#29765255)
Depends on the language and function. Some sorting algorithms happily rank ‘9’ > ‘10’.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @12:47PM (#29760728)
I'm curious which languages you learned in CS101 (actual question, not snark)

Every non-number, as you put it, is just a number to a computer. Comparing binary is faster than sorting strings, and it makes zero sense to waste memory simply so a human could potentially read it.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by jraph on Saturday January 01, 2022 @01:22PM (#29761050)
But versions are for human beings.

Otherwise, a timestamp, a date, a commit hash or an increment would do.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @01:33PM (#29761161)
That's not true, they can be for either humans, computers, or both. Software still has to understand and do something with that version number, even if it came from a human. And if it has to store, sort, or process that number a lot, it will still be faster to store and compare binary than a string.

For comparison, I think some here would be shocked to learn their IPv4 address is stored as an unsigned 32-bit integer. Its not a number, and definitely not faster to use as a string.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by wolf550e on Saturday January 01, 2022 @12:00PM (#29760257)
ISO8601 strings are sortable and are not numbers.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tuwtuwtuwtuw on Saturday January 01, 2022 @12:22PM (#29760475)
No they aren't.

10000 can be a valid year according to ISO8601, but sorted as a string it would come before year 2000, which would obviously be incorrect.

Here's from the ISO:

> 3.5 Expansion By mutual agreement of the partners in information interchange, it is permitted to expand the component identifying the calendar year, which is otherwise limited to four digits. This enables reference to dates and times in calendar years outside the range supported by complete representations, i.e. before the start of the year [0000] or after the end of the year [9999].

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by otterley on Saturday January 01, 2022 @02:21PM (#29761699)
Sounds like a problem we don’t have to worry about for another 8,000 years or so.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by SAI_Peregrinus on Saturday January 01, 2022 @03:13PM (#29762198)
Which comes first, "2021-W52-6T15:10.4" or "20220101T151115.1-05"? Lexicographic sort between those two ISO-8601 date/time strings will get it wrong.

Did you mistake ISO-8601 for RFC-3339? Even there lexicographic sorting isn't guaranteed, since you can have a pure date or a pure time or a date-time combined, and there's a choice between "T" and " " to separate dates from times in a date-time but it's much more likely to work than with ISO-8601.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by 88913527 on Saturday January 01, 2022 @12:17PM (#29760421)
Character sorting isn't a natural law. The fact that "A" comes before "Z" is historical; it's 'always been done that way'-- at least since the Phoenicians.

https://en.wikipedia.org/wiki/History_of_the_alphabet#Descen...

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mr_toad on Saturday January 01, 2022 @09:34PM (#29765177)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by lolinder on Saturday January 01, 2022 @11:56AM (#29760214)
Comparing strings is trivial, and would work out of the box with the format that they're using (YYMMDD###).
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by WoahNoun on Saturday January 01, 2022 @03:16PM (#29762223)
Posets aren't numbers either.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by akersten on Saturday January 01, 2022 @11:58AM (#29760230)
> the relevant one being a compare operation with a < or >

In Math we call that subtraction!