5 ms·
> You just have to internalize that major version numbers are not sacred, you’re not going to run out of them I know of at least 1 popular app that caused inte
by favorited 4y ago
> You just have to internalize that major version numbers are not sacred, you’re not going to run out of them
I know of at least 1 popular app that caused integer overflow when their version was parsed by a host system, so YMMV. Who would ever release a version greater than 65535, anyway?
- pwdisswordfish9 4y agoThe only reason fixed-width integer types exist is more or less a hack/optimization for doing fast and space-efficient integral math. Since these are total non-issues for the problem domain where version numbers are involved, there's no reason not to use a bignum instead, if available. Similar test: which is a more appropriate data type for ZIP codes, int or string?
- phoe-krk 4y agoObviously it's int, so you can do stuff like int zip_code = 01918 in C and then wonder why it doesn't even compile. /s
- oogali 4y agoWhen you say ZIP, do you mean USPS ZIP? USPS ZIP+4? Or non-US postal codes? Or all of the above?
- atoav 4y agoNon US ZIPs regularily have strings in them (e.g. Dutch ZIP codes) so a string would be appropriate.
- pwdisswordfish9 4y agoThis is half right. String would be more appropriate than an integer type even if that weren't true. ZIP codes really don't have anything to do with the fundamental numerical operations that are defined for integer types.
- dariusj18 4y agoplus zip codes can start with "0". Excel always screws this up
- oogali 4y agoI ran into that about 10 years ago with a certain infrastructure as code framework. I versioned my code as YYYYMMDD.patch then couldn’t get subsequent versions to deploy. After enough debugging I figured out it was due to my major version silently causing an integer overflow.
- stubish 4y agoMaybe fixed now, but my recollection is that .msi installers for Windows were limited to 0-255 for major and minor. Which sucked as I was trying to transition software using the year number as major.