3 ms·
I appreciate the general idea of using strong types, but I think the chosen example was a bit unfortunate and distracts from the actual problem. (Granted, it w
by yongjik 3y ago
I appreciate the general idea of using strong types, but I think the chosen example was a bit unfortunate and distracts from the actual problem. (Granted, it was a toy example, but still.)
Any system dealing with people will inevitably end up dealing with someone whose age is unknown. If the system cannot process this, these (very real) people will become "unrepresentable", with all kinds of consequences. Imagine a hypothetical story like "The hotel canceled my reservation because their system didn't have my age." Sounds familiar?
Also, ZIP code should be string, and you had better not have a type constraint for it, unless you never plan to sell anything overseas.
- awwsmm 3y agoA ZIP code is a U.S. postal code with a well-specified format. Global postal codes, however, are a different story... https://en.wikipedia.org/wiki/List_of_postal_codes https://en.wikipedia.org/wiki/List_of_postal_codes