I also fear there’s software that correctly extracts all the digits of the version in the user agent, but then compares it as a string with a given version. That would get you
“100” < “99”Slack's message buttons (such as "Add reaction" or "Reply in thread") stopped working for Firefox versions >= 100 and <= 519. They mysteriously started working again for versions >= 520. The version string "100" compared as smaller than "52" in Slack's code, which activated some kind of webcompat workaround intended for Firefox versions < 52 that breaks on more recent Firefox versions.
It's not crap, it's just short sighted.
It just baffles that someone can look at a monotonically increasing number, defined and incremented by a third party, and say "That will never be 3 digits."
A lot of software is written by junior programmers, not infrequently in a hurry. It's an easy mistake to make and if you've been bitten by it once you'll remember it, but many people have never been bitten by it.
More than just "very expensive". Often, you were limited to exactly 80 columns for each record. If you had for instance three dates on one record, using 2 digits instead of 4 digits saved 6 columns, which is over 7% of the available space.
"Ok"
if(userAgent.includes("Chrome") && userAgent[whatever] >= 4)
If that was a bug, I'd be pretty suspicious about the general software quality in the rest of the library.