4 ms·
> The database was written back in the days of 16-bit computing, so naturally it had a limit of 32,767 bugs I know it’s a nitpick; but no, that is not natural
by SlowRobotAhead 7y ago
> The database was written back in the days of 16-bit computing, so naturally it had a limit of 32,767 bugs
I know it’s a nitpick; but no, that is not natural to me at all. You can’t have a negative bug or would store it in list with negative indices. So using signed makes no sense to me.
Sometimes I get really confused why signed shows up in places it doesn’t belong.
- dragonwriter 7y ago> Sometimes I get really confused why signed shows up in places it doesn’t belong. Because in the absence of convenient sum types, you end up using a simple type with sentinel/special values so often that anything where the main value is logically non-negative (or strictly positive) but you don't have a clear reason to never need special values is done with a signed type where negative (and possibly zero) values are reserved or assigned to special uses.
- afiori 7y agoIt is the same reason the floating point standard loves NaN, exceptional "invalid" values allow you to encode recognizable extra information for error codes or error handling. It is bug prone, but also quite lightweight and flexible.