4 ms·
> And how many integers should actually be strings, unless you're dead sure this is a number. I phrase this as: If it doesn't make sense to do math on it, it'
by jdmichal 6y ago
> And how many integers should actually be strings, unless you're dead sure this is a number.
I phrase this as: If it doesn't make sense to do math on it, it's not a number. What does adding one to a customer account number mean? Absolutely nothing -- you get a completely different account number. So it's not a number, but a numeric string.
- lukasLansky 6y agoIt's not a string either though: in the same way integer addition (almost always) does not make sense, string concatenation (almost always) does not make sense either. The proper type would allow for equality check and explicit string (de)serialization only.
- jdmichal 6y agoI meant string in a more casual sense. From a more technical sense, it would be a symbol. I'll be more precise in the future.