News for hackers. Stuff that matters.
Re:Applying “make invalid states unrepresentable” by jdmichal on Monday October 05, 2020 @10:30AM (#24688069)
> 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.

Re:Applying “make invalid states unrepresentable” by lukasLansky on Monday October 05, 2020 @11:52AM (#24688846)
It'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.
Re:Applying “make invalid states unrepresentable” by jdmichal on Monday October 05, 2020 @12:32PM (#24689270)
I 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.