Hacker News new | past | comments | ask | show | jobs | submit login

The 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?




Non US ZIPs regularily have strings in them (e.g. Dutch ZIP codes) so a string would be appropriate.


This 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.


plus zip codes can start with "0". Excel always screws this up


Obviously 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


When you say ZIP, do you mean USPS ZIP? USPS ZIP+4? Or non-US postal codes?

Or all of the above?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: