3 ms·
> Credit cards and phone numbers aren't edge cases, but they're very clearly examples of data that should not be modeled as numbers. "Clearly" is debatable. Re
by epolanski 5y ago
> Credit cards and phone numbers aren't edge cases, but they're very clearly examples of data that should not be modeled as numbers.
"Clearly" is debatable. Regardless of how you input the data itself, nothing is stopping you from parsing and encoding it to a valid number of a certain type in a certain range.
Encoding it as something different than numbers seems even more dangerous and I have not seen yet an argument for it that goes beyond the input.
- JimDabell 5y agoSome places have phone numbers that are variable length and can start with a zero. If you store these as numbers, this will drop the leading zero and result in an incorrect phone number. Phone numbers aren’t numbers. Numerical values can be written as sequences of digits, but not all sequences of digits are numerical values.
- epolanski 5y agoMakes sense.