News for hackers. Stuff that matters.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by db48x on Saturday January 01, 2022 @09:47AM (#29758663)
Phone numbers are not numbers. Zip codes are not numbers. Model numbers are not numbers. Characters are not numbers. Which part of this progression escapes you?

Seriously, if you can’t add, subtract, multiply, and divide them, then they aren‘t numbers and you shouldn’t use a numeric data type for them. This is CS 101 knowledge. How badly does MS run their engineering?

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!

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by bob1029 on Saturday January 01, 2022 @10:54AM (#29759531)
I have found that any time you would refer to a thing as a "Code" or "Number", you are almost certainly talking about a string. Every property name in our codebase that contains one of these terms is a string type without exception.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dannyw on Saturday January 01, 2022 @11:32AM (#29759955)
If it's not a float or integer, it's a string.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by quesera on Saturday January 01, 2022 @12:25PM (#29760500)
And if it's currency, it should be an integer not a float.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by bob1029 on Saturday January 01, 2022 @12:36PM (#29760613)
We use decimals for all currency and rate properties. Integer is fine in many cases too.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by quesera on Saturday January 01, 2022 @01:23PM (#29761058)
Be careful with floats:

  20.40 == (20.39 + 0.01)
  => false
("decimal" can either be colloqually-equivalent to "float", or it can refer to a distinct data type which is supported by some languages and databases. A proper decimal type is currency-safe to use, if available.)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ajross on Saturday January 01, 2022 @10:27AM (#29759179)
It's neither a phone number, zip code, nor model number. It's a version number. And version numbers don't multiply or divide, but they do compare. This kind of code has a decades-long history:

    #if BUILD_VERSION >= FIRST_VERSION_THAT_WORKS
    ...
    #endif
And in fact if you look around, almost every large C or C++ project has a WHATEVER_VERSION token (c.f. LINUX_VERSION_CODE for the kernel) that packs the version into a comparable integer literal.

The bug here is that they picked an encoding that was obviously going to overflow in a Y2.022K bug, not with the technique.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by cesarb on Saturday January 01, 2022 @11:06AM (#29759647)
> [...] almost every large C or C++ project has a WHATEVER_VERSION token (c.f. LINUX_VERSION_CODE for the kernel) that packs the version into a comparable integer literal. The bug here is that they picked an encoding that was obviously going to overflow [...]

Speaking of LINUX_VERSION_CODE, it had a similar problem recently. See the article at https://lwn.net/Articles/845120/ which was summarized in this year's LWN.net retrospective at https://lwn.net/SubscriberLink/879053/aaea44782e8c760d/ as follows:

"Sometimes the most obvious things can be the hardest to anticipate; consider, for example, the case of minor revision numbers for stable kernel releases. A single byte was set aside for those numbers, since nobody ever thought there would be more than 255 releases of a single stable series. But we live in a different world, with fast-arriving stable updates and kernels that are supported for several years. It should have been possible for us, and for the developers involved, to not only predict that those numbers would overflow, but to make a good guess as to exactly when that would happen. We were all caught by surprise anyway."

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ajross on Saturday January 01, 2022 @11:19AM (#29759801)
Similar, but with the important distinction that this problem was recognized months in advance and remedied with some care (or kludge, depending on your preferences), and didn't become a bug in production software.

All computers work in finite representations. All values can overflow. Good engineering is about working within that world and not trying to Quixotically design its absence.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by rbobby on Saturday January 01, 2022 @11:07AM (#29759656)
YYMMDD + 4 digits of versions. At a glance, even a bit more than a glance, that seems fine for a long. And if 2020 worked and 2021 worked... why would 2022 break?

Lol.

I'd bet the conversation about this way back when it was being decided was "will 3 digits for daily version/build be enough" and the answer "go with 4, better safe than sorry".

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by frays on Saturday January 01, 2022 @09:53AM (#29758732)
The only reason I can think of is YYYYMMDDHHMM represented as an unsigned long is 4 bytes, while the equivalent in characters would require 12 bytes.

Is it possible that at Microsoft's scale this would actually make a significant difference?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @10:34AM (#29759275)
Anything you do will take 3x the memory, so yes... I cant see why anyone would store as a string internally, you have to decode into a number anyway so just extra work. Strings are only useful to humans.

Edit: reading all the comments here, I get the feeling high level programmers don't fully understand how things are represented at the low level, there is no purpose in storing a version/serial as a string.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by foepys on Saturday January 01, 2022 @11:17AM (#29759784)
There are lot of "numbers" not actually being numbers. E.g. phone "numbers" are not numbers. The same as a house "numbers" are not numbers. Version "numbers" are also often not numbers (e.g. 2.1.230-rc.1).

If the OP bug was really triggered by a string of numerical characters not fitting into a 32bit integer, all the trouble of saving a few bytes on the client system were not worth it.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @11:32AM (#29759952)
Yes, that is what the OP of the thread said, I've read it. Version numbers can be numbers if you want, and plan them to be. Which is the case here, its not a string fit into a 32 bit integer, its actually an integer. But they didn't think to check the max size which would only fit in an unsigned. Its an odd choice on their part, but certainly would have worked.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by foepys on Saturday January 01, 2022 @11:34AM (#29759973)
This very much depends on the protocol. Microsoft loves XML and and if the update package has an XML manifest with update information attached to it, it's very well a string that gets serialized to a number. The same applies to JSON and other text-based formats.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @11:48AM (#29760130)
And that is fine though because at some lower level everything becomes a number to a computer. I think everyone is getting hung up on this string/number difference; data from humans is going to come as a string, thats no reason to store or process it as such.

Plenty of data is stored in varied types for processing that are efficient for a computer, for example DNS has been using date-based serial numbers successfully for decades, and stored internally as uint32.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by jeroenhd on Saturday January 01, 2022 @12:27PM (#29760523)
Re your edit: these days, most developers are web developers where people don't care about these optimizations.

It's a little silly that a test didn't catch this problem, but using a version number somewhere high up in the long makes total sense to me. After all, version numbers can be anything you define them to be, as long as they're unique. You'd like them to be sortable, but they don't even have to be.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @12:42PM (#29760668)
Sorry, I edited twice (just for confusion hah).

I don't think it's that they don't care, I suspect many simply do not understand what is under the hood in the first place; and they don't need to when doing web development. The fact that some here suggest storing version as a string is some how faster and safer is a big give away.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by jeroenhd on Saturday January 01, 2022 @12:57PM (#29760836)
Perhaps saying they don't care is a bit much, they usually just don't need to care. The data is delivered to most websites in the form of JSON which can be parsed to any data format you want, and at that point it might even be faster to do a string compare to skip the double/int conversion.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @01:17PM (#29761006)
I got what you were saying. That certainly may be case, depending on application. It looks in this case like its just definition files being loaded into memory, and if they need to compare that version more than once, doing it as a single operation binary comparison will be significantly faster than continually comparing a UTF-8 string (SIMD aside)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pintxo on Saturday January 01, 2022 @10:09AM (#29758945)
It probably did, 25 years ago
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by throwuxiytayq on Saturday January 01, 2022 @10:10AM (#29758962)
Not likely. Modern software developers laugh this kind of difference away, and will almost always default to taking a memory/storage space hit over other possible trade-offs (performance, correctness, convenience...)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by watermelon0 on Saturday January 01, 2022 @10:35AM (#29759287)
Considering storage/memory requirements for modern desktop/mobile apps, I wouldn't mind if developers would occasionally think about optimizing them.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by xigoi on Saturday January 01, 2022 @11:42AM (#29760056)
Storing non-numeric data as strings is not what makes modern apps bloated. It's the technologies used (Electron) and a general “I don't care” approach.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Dork1234 on Saturday January 01, 2022 @11:00AM (#29759607)
Nah, we computer scientist are happy embedding electron into every application no matter how small.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by selfhifive on Sunday January 02, 2022 @12:43AM (#29766197)
Application developers not system engineers. People who work on high performance servers will always look to reduce overhead as much as possible.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by yodelshady on Saturday January 01, 2022 @12:02PM (#29760278)
a simple tuple of appropriately-sized integer types would only need 8 bytes, which coincidentally is what MS will need come 2043.

That does mean rolling your own "greater-than-or-equal" operation though.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by zitterbewegung on Saturday January 01, 2022 @09:54AM (#29758746)
The only reason I can think of is that storing a version as a number would allow you to check if your version is incompatible with another server or feature / extension. By using less than or greater than.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ilikehurdles on Saturday January 01, 2022 @10:07AM (#29758919)
Not necessarily.

2.2 is greater than 2.12 but v2.2 is actually an early predecessors to v2.12

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mmis1000 on Saturday January 01, 2022 @10:14AM (#29759007)
That would work if padding is always forced (like date). And in this case, it actually is.

2.02 is smaller than 2.12

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pfooti on Saturday January 01, 2022 @10:17AM (#29759045)
Best hope you don't end up releasing 2.100 then
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mmis1000 on Saturday January 01, 2022 @10:41AM (#29759357)
It can also ends up as 2.99.01. Jokes aside, there is another bug caused by some poor programmer hard-coded the length of version field recently. https://news.ycombinator.com/item?id=29702128
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by zmmmmm on Saturday January 01, 2022 @08:16PM (#29764715)
that is exactly why you would create a transformation to something like a big fat integer with each segment of the version number isolated to separate parts of the bit mask so you can compare it as an integer.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by frays on Saturday January 01, 2022 @09:58AM (#29758804)
If they were stored as characters you could still do a string comparison using greater than and less than signs and logic.

"202201010001" > "202112122359"

evaluates to True in Python, SQL and many other languages.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by oefnak on Saturday January 01, 2022 @10:10AM (#29758955)
But "1000"<"999" in Python.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by laumars on Saturday January 01, 2022 @10:18AM (#29759062)
String comparison works as long as you order your date time by significance and zero pad all values, which they were doing with their date stamp anyway.

Plus if they weren’t then even numerical comparisons would fail eg 1012021 (Oct/1/2021) < 5102020 (May/10/2020) so you argument is moot.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by jpambrun on Saturday January 01, 2022 @10:17AM (#29759044)
This is going to be a problem in about 8,000 years tho.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by 6c696e7578 on Saturday January 01, 2022 @11:26AM (#29759890)
Wouldn't it be done more like this though?

  "%04d%02d%02d" % (999,1,1)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by thomasfedb on Saturday January 01, 2022 @10:15AM (#29759021)
But the format and length for these numerical strings is fixed.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by SAI_Peregrinus on Saturday January 01, 2022 @02:59PM (#29762045)
I'd say if they don't form an ordered field, they shouldn't be called "numbers". The complex numbers really ought to be called an algebra, not numbers. They're the dimension-2 Cayley-Dickson algebra, after all!
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ed25519FUUU on Saturday January 01, 2022 @11:38AM (#29760016)
This is so extremely common that it’s funny to me you scoff at it.

Under the hood these systems will convert to some numerical format to compare which version is newer. You store it as a (proper) numerical format or you serialize it into one later, but at the end of the day it’s a number because that’s how you compare it.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by hiptobecubic on Saturday January 01, 2022 @10:08AM (#29758937)
Version numbers can of course be numbers, but the problem here is that they were constructing a number like a string from semantically meaningful constituent parts (and not testing thoroughly).
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by raverbashing on Saturday January 01, 2022 @10:25AM (#29759153)
And again, if there are no negative versions, they should have used an unsigned int, not an int.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by genewitch on Sunday January 02, 2022 @10:51PM (#29777133)
pushing the date that it breaks to the version released in 2043?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @10:39AM (#29759326)
You're right but thats not the issue here, the version is structured as a number but they failed to give it a type large enough to represent it; simply a signed/unsigned screwup.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by masklinn on Saturday January 01, 2022 @11:16AM (#29759770)
That's not a fix, barely an improvement, really just a shitty workaround: the exact same issue rear its head again in 2043.

The actual fix is exactly what the original comment states: a version is not a number.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @11:25AM (#29759870)
Oh I agree its a bad long term solution, but assuming they had noticed and used the correct type, 2043 is likely well past the lifetime of the product and would have worked fine till then. Not great, but certainly passable.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by masklinn on Saturday January 01, 2022 @11:44AM (#29760077)
> Oh I agree its a bad long term solution, but assuming they had noticed and used the correct type, 2043 is likely well past the lifetime of the product

You expect Microsoft Exchange to stop being used some time in the next 20 years?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @11:52AM (#29760179)
That version yes, absolutely. I expect at some point Microsoft will have made enough updates that they will say X version is no longer supported, and it will stop working on its own. And its not like it's a product installed on some embedded device that will never get updates until then, Exchange will get security fixes for as long as it is exists and nobody will be running this version in 20 years.

Even more likely, we'll have new protocols the current version doesn't support, so the bug will have been long fixed or noticed.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by masklinn on Saturday January 01, 2022 @12:00PM (#29760255)
> That version yes, absolutely.

But in your alternate timeline the issue would only have been hit in 2043, and since in our timeline it was not noticed before it was hit, there is no reason to believe it would have been noticed in the alternate.

So the exact same issue would have occurred, a few years later.

I fail to see why that would be an improvement.

> Even more likely, we'll have new protocols the current version doesn't support, so the bug will have been long fixed or noticed.

That is a completely unsubstantiated assertion.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @12:23PM (#29760480)
I'll quote myself again, "Oh I agree its a bad long term solution, but assuming they had noticed and used the correct type, 2043 is likely well past the lifetime of the product and would have worked fine till then"

I never suggested it was any improvement except for the advantage of time; although I shouldn't have used the word 'correct'. Signed 32-bit dates have a well known limitation that people will likely hunt and fix over the next 20 years. But yes, its all unsubstantiated, no doubt there.

The real main point of my post you first replied to is that it doesn't matter that the version was stored as an integer. The failure happened when they used their own format and didn't confirm it was properly bounded. Everyone here is having a hard time grasping how their data is stored and processed at the low level - your 'string' is still just an array of 8-bit bytes.

Storing an only-increasing number as any form of integer is a perfectly acceptable, and efficient way for a computer to compare and process. Version numbers are one of those. Phone numbers are obviously not.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by lolinder on Saturday January 01, 2022 @12:04PM (#29760298)
The version is not structured as a number, it's structured as a string of digits that incidentally resembles a number. There are no operations that take two version numbers and return a new version number, so they are not numbers.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @12:35PM (#29760599)
That is how they are entered by a human, yes. Then they are converted to binary and processed, like everything else. There is no need to add two version numbers together, but as they only ever increasing, its sane and efficient to store, and compare binary.

Everything in software takes data in one form and processes it into another. There are no 'strings', there are no version numbers. There is only binary. They simply did not give enough space to store it, thats all.

DNS is a perfect example, which stores serial numbers internally as an unsigned 32 and has worked for decades and will continue to. But they chose the format of YYYYMMDDnn which will last far longer than a 2 digit year.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by hulitu on Saturday January 01, 2022 @09:52AM (#29758721)
Just look at Win 10 and at Teams for examples. The only engineering which counts at MS is the one which maximizes profits.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Demiurge on Saturday January 01, 2022 @10:01AM (#29758846)
And how is this different for everyone else in the free market economy?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dijit on Saturday January 01, 2022 @10:28AM (#29759193)
I had a weird kind of epiphany when I was watching the fireworks over Sydney last night.

The harbour bridge has lights on it.

For what financial benefit?

The fireworks display itself, I can't understand where the financial benefit is and it costs millions of dollars. ($7 million as far as I'm aware)

---

I think that you could make a financial motivation statement for making good software (it makes it less likely for people to switch, for example), but my broader point is: why does everything have to be financially motivated?

Because, a lot of stuff that we enjoy doesn't seem to be primarily financial in nature.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dylan604 on Saturday January 01, 2022 @10:39AM (#29759322)
>The harbour bridge has lights on it.

>For what financial benefit?

Same for the Opera House. Imagine all of those stock photos of Sydney. Now narrow those down to the nighttime shots of Sydney. Imagine those without lights on the bridge or opera house. For that matter, any of the lights on any of the buildings. What do you have left? A really boring photo. Nobody wants to visit a city with really boring photos. What's the financial benefit of that?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jon_Lowtek on Saturday January 01, 2022 @10:52AM (#29759502)
Does not compute. What's the financial benefit of selecting cities based on how well lit their photos are?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by selestify on Saturday January 01, 2022 @11:01AM (#29759610)
Better lit structures make photos of them look better. Tourists choose destinations to spend money at based on how good the photos of the destinations look.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jon_Lowtek on Saturday January 01, 2022 @11:09AM (#29759686)
that doesn't answer my question, i was asking why the tourist selects like that. How does selecting based on how well lit photos are create a financial benefit for the tourist? ;-)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ben-schaaf on Saturday January 01, 2022 @11:42AM (#29760057)
It's not for the benefit of the tourists at all, it's an advertisement to increase tourism for the benefit of local businesses.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Jon_Lowtek on Saturday January 01, 2022 @12:00PM (#29760258)
Yet such adverts should not increase tourism because tourists must surely prefer to visit cities that offer benefits for tourists.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dylan604 on Saturday January 01, 2022 @01:18PM (#29761021)
You're such a troll. The benefits of tourists to the tourist for visiting a city can come in many forms, and financial benefit is rarely one of them. In fact, it typically comes at great financial cost.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by SAI_Peregrinus on Saturday January 01, 2022 @03:24PM (#29762321)
That's their point. Not everything done in a market economy is done with a goal of gaining a financial benefit.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by selestify on Tuesday January 04, 2022 @10:58AM (#29796188)
> cities that offer benefits for tourists

An aesthetically pleasing scenery would be one of those benefits.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by watt on Saturday January 01, 2022 @11:45AM (#29760084)
A lot of things about humans is based on desire, not on logical conclusion or requirement. Humans do things because they want to, not because they need to or it's the logical or rational thing to do.

Evoking desire is key.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dijit on Saturday January 01, 2022 @12:11PM (#29760366)
So taking this whole comment chain into consideration, why are Windows 11 and Teams going out of their way to be awful to use?

We agree that the Free Market(tm) incentives are to maximise desire even at an up-front loss (Fireworks, Lighting the bridge) but the parent said that it's free market economics that prevent Teams and Windows from being desirable to use.

Is someone wrong or am I misunderstanding something?

Is there more profit in awful things? Why does the Harbour bridge have lights then?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dylan604 on Saturday January 01, 2022 @01:16PM (#29761001)
Why are we even trying to equate the 2 things? The harbor bridge has a very pleasant look and people want to accentuate that, so they have decided to put lights on it so that it can be enjoyed at night. There is a very pleasing affect from things being lit at night. Why why why is this hard/difficult to grasp?

That is so so so different from a group of engineers building a product and totally not grasping that while it technically works, it is not pleasant for the end users. It takes a certain level of asshattery to assume that the devs are going out of their way to make it this way.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Demiurge on Saturday January 01, 2022 @11:02AM (#29759622)
city user experience :)

There is the same financial incentive for MS to fix their Y2k22 bug.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mind-blight on Saturday January 01, 2022 @11:27AM (#29759901)
It doesn't have to be, but our economy is structured to name it one of the primary ways to justify something's existence, Ave basically the only way to make something sustainable.

The incentive structures are built to make financial incentives take precedence with most things

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by reaperducer on Saturday January 01, 2022 @12:28PM (#29760528)
A lot of people and companies take pride in their work. Saying that people are only in it for a buck is a tired old cliche that is easily disproven through even casual observation.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by samstave on Saturday January 01, 2022 @10:39AM (#29759320)
Isn't it lovely that Bill Gates' famous words are that vaccines are the best investment he has ever made?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by fortran77 on Saturday January 01, 2022 @10:06AM (#29758910)
> How badly does MS run their engineering?

Bad enough to be a 2.53 Trillion Dollar company.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pvillano on Saturday January 01, 2022 @11:13AM (#29759739)
side note

some numbers^* cannot be meaningfully multiplied or divided. For example, 3^rd place, 30° F, or 37.388N,-122.067S.

Some numbers can only be added to by numbers of a different type. For example x°C + y°K, 3rd grader + year, absolute position + offset. Similarly, subtracting two of these numbers results in a different unit. e.g. position - position = offset

it would be great if someone could comment the exact terminology for what I'm trying to describe.

* Types/Units

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by john-aj on Saturday January 01, 2022 @02:03PM (#29761469)
In statistics, one usually differentiates between

- nominal scales (e.g. man/woman),

- ordinal scales (elementary school/middle school/high school),

- interval scales (degrees Celsius) and

- ratio scales (human height, degrees Kelvin).

Only ratio scales may be multiplied and divided. Interval scales may be subtracted and added. Ordinal scales may only be compared (less/greater/equal). Nominal scales may only be compared in terms of (in)equality.

https://en.wikipedia.org/wiki/Level_of_measurement

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pvillano on Friday January 14, 2022 @09:11AM (#29934565)
thank you! this is that I was looking for
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mind-blight on Saturday January 01, 2022 @11:25AM (#29759876)
I'm not sure if it's what you're looking for, but algebraic days types are a fairly common way to encode different kinds of days that have the same shape.

You may also be looking for fields: https://en.m.wikipedia.org/wiki/Field_(mathematics). You could probably also describe the relation between different number types as linear operators over a vector space

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by jongalloway2 on Saturday January 01, 2022 @03:37PM (#29762459)
F# has Units of Measure: https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...

There are libraries that implement this concept in other programming languages (C++, Java, C#, etc.)

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by samus on Saturday January 01, 2022 @04:12PM (#29762859)
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by snicker7 on Saturday January 01, 2022 @11:11AM (#29759713)
Time is a number. At least, it makes sense to subtract them (I guess you can say that time is a one dimensional affine space).
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pjc50 on Saturday January 01, 2022 @11:16AM (#29759773)
Time is a number and a location. If you normalize everything to a reference time such as the UNIX epoch, you can usually do subtraction. Even then you may have got the times from a non-monotonic clock ...
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by bsza on Saturday January 01, 2022 @11:17AM (#29759778)
Time is a number, but a date is not. 211231 + 1 != 211232.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by karpierz on Saturday January 01, 2022 @12:22PM (#29760472)
To be specific, that representation of date does not implement integer addition. To be fair, neither do most "number" types (uint, int, float, etc).

For uint, you actually have x + y = (x + y) mod MAX_UINT.

For float, sometimes x + 1 = x.

The issue is not that date is not a number, but that people poorly reason about common cases of date arithmetic. Similar stuff comes up for floats and ints but they're just easier to reason about.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by gkop on Saturday January 01, 2022 @12:51PM (#29760771)
> For float, sometimes x + 1 = x

Would you spell this out for us?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by eska on Saturday January 01, 2022 @01:14PM (#29760989)
If x is a huge number, then elimination can happen. Floating point numbers store a mantissa and an exponent, m^e. When you have a huge number the exponent will be large. So the mantissa can not express the tiny number anymore.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by cmeacham98 on Saturday January 01, 2022 @03:42PM (#29762515)
Floats effectively work by specifying a level of precision and a multiplier against that. For big numbers, you need a lower precision (larger gap) between the representable values. Eventually the precision gets so low that adding 1 doesn't reach the next possible value and rounds back down to your current value.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kaba0 on Saturday January 01, 2022 @11:21AM (#29759826)
Bit of a nitpick, but due to relativity, time is not simply a number though.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by wyldfire on Saturday January 01, 2022 @11:25AM (#29759877)
Relativity is not modeled in the vast, vast majority of computer systems that track time. So the nitpick is irrelevant.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kaba0 on Saturday January 01, 2022 @11:33AM (#29759963)
But there are rare software that model it (eg. GPS systems famously have to account for it) - so I think it is a textbook definition of a nitpick.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kzrdude on Saturday January 01, 2022 @11:13AM (#29759743)
just like pointers, it makes sense to subtract them and add offsets but to straight up add them makes no sense.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by michaericalribo on Saturday January 01, 2022 @12:47PM (#29760727)
Well, to put on my pedantic hat and indulge my inner math major, what you describe is algebra on top of objects—you’re talking about the math that applies to numbers, not the numbers themselves. Specifically you described groups and fields and rings…the symbols themselves are numbers, but they don’t recombine with each other in the same way as other numbers.

You’re right that they shouldn’t be implemented a numeric data types.

That said, dates do have properties of modular arithmetic, so in a strange sense they are very much numbers…

:p

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by comboy on Saturday January 01, 2022 @03:18PM (#29762252)
Everything ends up in your database as bytes. You can say everything is a number. It's just naming. Whether it's sane to do basic math operations on them is loosely correlated with whether user sees that number as an integer on his screen.

Most bugs are stupid and should be obvious. They happen.

You can look at your old code and say WTF, so judging decisions in somebody's else complex system without having any idea about requirements and constraints seems pointless.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tyingq on Saturday January 01, 2022 @09:55AM (#29758753)
Not that it excuses the issue, but I suspect the motivation was numeric sorting to identify the newest. So it was sort of a number in that respect.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by LadyCailin on Saturday January 01, 2022 @10:22AM (#29759118)
Not criticizing you, but no, it’s a string which happens to have a natural ordering. The fact that it happens to look like a number is irrelevant.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by boardwaalk on Saturday January 01, 2022 @10:40AM (#29759335)
It’s like nothing could have multiple useful forms. Which is of course not true. This is just a dumb bug.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tyingq on Saturday January 01, 2022 @10:42AM (#29759359)
The idea wasn't justifying the choice, but rather trying to imagine what happened. Because they did want a way to sort and pop the highest numeric value, they made a bad choice.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by collegeburner on Saturday January 01, 2022 @10:51AM (#29759489)
Sometimes a performance reason? Number is usually smaller, faster, also better if stored in a database and more efficient if used as a primry key,
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ClumsyPilot on Saturday January 01, 2022 @01:53PM (#29761363)
Gotta free up space for those electron apps
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by yholio on Saturday January 01, 2022 @11:04AM (#29759632)
These are version numbers. It's perfectly fine to use numbers to express version numbers, a great majority of protocols reserve numeric fields for this.

The problem here was basic overflow, they reached a version number exceeding the capacity of the numeric type.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tomjen3 on Saturday January 01, 2022 @09:56AM (#29758770)
But they are. Zips here in Denmark are clustered progressively, so that if you have a package going to (say) 8600 and 8704 then it makes some sense to send those orders to the same distribution node, since they will be close together, but to do that you need to treat them as numbers.

My grandparents first phone number was 13. Not because they got in super early and had the 13th phone number in the country, but because that was the 13th number for their exchange. When a bunch of exchanges were put together everybody got another number in front of theirs. Their phone number is much longer today, but it still ends in 13.

I guess you could treat the phone numbers as strings, but I don't know if you can do that with the Danish zip numbers.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by silvestrov on Saturday January 01, 2022 @10:34AM (#29759265)
You should never use clustering/subtraction on Danish zip codes as a source of "how hearby". To quote https://www.postnumre.dk

   2400 Copenhagen NV (North West)
   2412 Santa Claus, Greenland 
   2450 Copenhagen SV (South West)    
   ...
   3790 Hasle (close to Roskilde)
   3900 Nuuk (Geenland)
   3992 Dog sled patrol "Sirius"
   4000 Roskilde
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by wombatpm on Saturday January 01, 2022 @12:26PM (#29760507)
Unless it is encoded in its design. For US zip codes the first three digits encode a geographic region. But there is no guarantee that 601 is next to 602
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by pintxo on Saturday January 01, 2022 @10:11AM (#29758970)
Lots of phone numbers start with a zero, converting string to numbers will most likely change the phone number by removing the information of the leading zero. Doing this in js will store it as base 8. Neither will make anyone happy.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by bombcar on Saturday January 01, 2022 @10:16AM (#29759039)
Excel loves replacing phone numbers with 12031041e8 or whatever when importing CSV. So useful.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dylan604 on Saturday January 01, 2022 @10:48AM (#29759450)
This is one of the most annoying things to me about Excel (of a long list). In pretty much every time MS applications feel they are smarter than me ends in MS application being wrong. It doesn't matter if the data is manually typed or pasted from else where, when Excel tries to auto-guess how to set the formatting of the cell is just horrid. Dates are shite when trying to be in the US and using UK formatted dates.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by hermitdev on Saturday January 01, 2022 @11:53AM (#29760187)
What's even worse is if you inadvertently save the CSV with the auto format, the data will be lost, too. Excel is both a wonderful tool and the bane of my existence when dealing with financials.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by chiph on Saturday January 01, 2022 @10:52AM (#29759507)
Even in North America, you shouldn't treat ZIP/postal codes as numbers. The US added 4 digits 30-ish years ago (ZIP+4) and they're separated with a dash. You could store them as separate numbers [0] and rely on the presentation code to add the dash. But since Canada has alphanumeric postal codes (Mexico uses numbers), you're better off treating them as a string field.

The US used to prefix phone numbers with letters (like MElrose 1-2345) as an aide-mémoire during the transition to 8 digits with area codes. And you'll still see businesses advertising with letters in place of digits (like 800-GOT-JUNK which is a junk removal firm) but they never get entered into phone number fields like that. The best reason to have phone numbers as text though, is the digit groupings [1]. In North America, it's 3-3-4 but other countries group their numbers differently to help people remember them. So allowing users to enter numbers in their format you're making it easy for them.

[0] The main reason to do this is if you're in the business of sending out mailings. The US postal service gives discounts if you sort and bundle by ZIP code, and mixed ZIP and ZIP+4 values would make that hard.

[1] https://en.wikipedia.org/wiki/Chunking_(psychology)

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by akersten on Saturday January 01, 2022 @12:08PM (#29760338)
A ZIP code is an identifier made of numerals, it is not a number in the mathematical sense. It does not make sense to multiply, add, subtract, or divide them - even though the numerals are assigned in apparently ascending order. There's nothing preventing a future decree from making one that starts with a Z, or a 0, or putting a dash in the middle of it. It is foolish to store it as an integer type.

You can cluster them for distance without storing them as an integer. Just throw them in a graph data type and compute edges having actual integral weights. The ZIPs themselves are not what you want to be doing your math on.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by MikusR on Saturday January 01, 2022 @10:24AM (#29759148)
But you can add and subtract dates.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by adolph on Saturday January 01, 2022 @11:29AM (#29759918)
The map is not the territory.

The efficacy of any computational operator on a specific representation does not impute the same for all instantiations since the semantic link between identity and representation may only exist in the mind of the programmer and not the computational device.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by db48x on Saturday January 01, 2022 @10:55AM (#29759541)
You can only add a Duration to a Timestamp; you cannot add two Timestamps.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Turbots on Saturday January 01, 2022 @10:33AM (#29759256)
Add March 5th to June 2nd...
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by _dain_ on Saturday January 01, 2022 @12:54PM (#29760800)
August 5th.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dehrmann on Saturday January 01, 2022 @01:04PM (#29760896)
You should try PHP. You can multiply all sorts of things!
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by darau1 on Saturday January 01, 2022 @11:57AM (#29760228)
We use exchange at work. Daily, I will utter some form of "Microsoft can't do anything right, man".
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dehrmann on Saturday January 01, 2022 @01:10PM (#29760951)
I used to work on a customer API that accepted these fields as JSON. My first project was improving validation (I used JSON schema) while not breaking existing integrations. While it's true that those fields aren't numbers, I saw all those fields sent as numbers.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by skrebbel on Saturday January 01, 2022 @10:01AM (#29758849)
Captain Hindsight strikes again!
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by NelsonMinar on Saturday January 01, 2022 @10:38AM (#29759308)
So.. are database IDs numbers? Because they sure are autoincrement integers in almost every DBMS. I always thought that was a mistake but it's practical.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by masklinn on Saturday January 01, 2022 @11:17AM (#29759785)
> So.. are database IDs numbers?

No.

> Because they sure are autoincrement integers in almost every DBMS.

The autoincrement occurs before it's a database ID. The generator for database ids is a sequence, that has no bearing on the semantics of the database ids.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Quekid5 on Saturday January 01, 2022 @10:41AM (#29759346)
Yes, but as soon as they leave the realm of the DB itself, they (should) become opaque identifiers.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by marcosdumay on Saturday January 01, 2022 @11:43AM (#29760074)
They are absolutely not numbers.

As many people already commented, it's reasonable to encode things as numbers as long as you keep in mind there's an encoding operation with it's possible flaws.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by kenjackson on Saturday January 01, 2022 @12:43PM (#29760682)
Honestly that seems like a cop out.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by marcosdumay on Saturday January 01, 2022 @03:42PM (#29762506)
The usual habit of typing ids as integral numbers is incorrect, they are not numbers. But the problems it causes are well known and dealt with by what is broadly known as good practices.

Is it better this way?

(You can see the problems clashing with each other if you search for discussions about defaulting ids to 32 or 64 bits. So they are not completely solved, the practices are just good enough that things don't usually break on practice.)

At the end of the day, all you have on a computer is a bitfield to mess around. You will always have to deal with encoding at some point.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Spivak on Saturday January 01, 2022 @01:16PM (#29761003)
I mean strings are numbers if you want to be that reductive. The “on-disk” representation of the thing is independent of its real type and properties.

So sure, store a date in an “integer” but if you try to treat it like one instead of a bitfield you’ve made an error and if your storage isn’t wide enough to hold all dates that’s gonna be a PITA later.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by mind-blight on Saturday January 01, 2022 @11:30AM (#29759942)
It's becoming pretty standard to use UUIDs over integers now. That provides more architectural flexibility
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by dheera on Saturday January 01, 2022 @11:45AM (#29760083)
> How badly does MS run their engineering?

I think the real problem is ... how many good engineers and engineering managers nowadays want to work at MS?

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by rbanffy on Saturday January 01, 2022 @02:12PM (#29761583)
> Seriously, if you can’t add, subtract, multiply, and divide them, then they aren‘t numbers

Sadly, sometimes you can, regardless of whether you should.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Kevin578 on Saturday January 01, 2022 @11:33AM (#29759968)
isnt working with integers generally faster than working with strings? that might be why some ppl store phone numbers and zip codes as int
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by reaperducer on Saturday January 01, 2022 @12:35PM (#29760598)
that might be why some ppl store phone numbers and zip codes as int

Anyone who stores ZIP Codes as an int should have his dev license revoked. You've just corrupted the data you store for a hundred million people in the northeast.

I'm currently dealing with a situation where a system developed by an offshore team stored Social Security numbers as integers. They had no idea that an SSN can start with a zero, and didn't even do a basic web search to see what the possible range of values is before designing the database and application.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Kevin578 on Saturday January 01, 2022 @01:37PM (#29761199)
you can tell a 4 digit zip code has a leading zero that was removed though. you'll also get faster sql queries if you search for zip codes as int vs string
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by reaperducer on Saturday January 01, 2022 @03:03PM (#29762079)
you can tell a 4 digit zip code has a leading zero that was removed though

Only if you're 100% sure your date is completely clean. Only very rarely is this the case, especially with ZIP Codes because the data almost always traces back to human input.

The initial query may be quicker, but then you have to compensate for the missing digits elsewhere, likely multiple times. You have to consider the expense to the whole system, not just to one query.

Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ben-schaaf on Saturday January 01, 2022 @11:38AM (#29760021)
Not if the only thing you're doing with the number is converting it from/to a string...
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by petee on Saturday January 01, 2022 @03:03PM (#29762086)
And its very doubtful that is all Exchange is doing with it. Likely they have a large list of definitions to compare and track.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Pxtl on Saturday January 01, 2022 @10:32AM (#29759241)
We need null-terminated binary-coded-decimals as a standard datatype for cases like this. "Numeric String".
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by ananonymoususer on Saturday January 01, 2022 @10:43AM (#29759374)
Okay, so if it's null-terminated, how does one represent a zero?
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by Pxtl on Saturday January 01, 2022 @01:06PM (#29760922)
F-terminated might work better (given 1-nybble-per-digit BCD), or do a Pascal-style length prefix. I was less fixated on the implementation detail than I am about the basic concept of: arbitrary length numeric strings with numeric semantics and string-like storage and length characteristics.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by tom_ on Saturday January 01, 2022 @11:54AM (#29760192)
Decide that the null value is one of the invalid digits - e.g., %1111. 0 can remain %0000.
Re:Microsoft Exchange stops passing mail due to bug on 1/1/22 by edoceo on Saturday January 01, 2022 @12:04PM (#29760303)
"0\x00"?