News for hackers. Stuff that matters.
Re:An erroneous paper on religion and generosity is retracted by _edo on Friday September 27, 2019 @03:46PM (#21095616)
Sometimes I feel weird coding zip codes as strings but this is a great example why. If my program ever treats a zip code like a number I would like it to throw an error. At least in this case the error looks like an accident.

On topic, from yesterday: https://news.ycombinator.com/item?id=21067764

It's another social sciences paper but in this case a co-author has requested a retraction over his strong belief that the paper includes fabricated data. The retraction request has been denied. It differs from this paper in that the data anomalies look intentional.

Re:An erroneous paper on religion and generosity is retracted by haasted on Friday September 27, 2019 @03:51PM (#21095661)
My rule of thumb is that anything that’s not part of a calculation will be a string. Any chance I ever want to multiply a zip code? Doubtful. String, it is.
Re:An erroneous paper on religion and generosity is retracted by ars on Friday September 27, 2019 @04:30PM (#21095985)
> If my program ever treats a zip code like a number I would like it to throw an error.

One interesting thing you can do though, is sort by zipcode. This sorts your mail from East to West in the US. You can use that as a rough estimate of shipping time.

Re:An erroneous paper on religion and generosity is retracted by _edo on Friday September 27, 2019 @04:52PM (#21096163)
That's really cool, even if I never find a place to use it.

Anyway you can still sort strings.

Re:An erroneous paper on religion and generosity is retracted by LorenPechtel on Friday September 27, 2019 @04:46PM (#21096110)
So? You make sure the zip code is left zero filled and the strings sort fine. Admittedly, numbers would sort a bit faster.
Re:An erroneous paper on religion and generosity is retracted by crooked-v on Friday September 27, 2019 @03:50PM (#21095651)
Non-US postal codes often include letters and spaces, and some areas don't use postal codes at all.
Re:An erroneous paper on religion and generosity is retracted by jedberg on Friday September 27, 2019 @04:23PM (#21095927)
All US postal codes have an optional - (hyphen) in them as well, and so you should always encode them as strings anyway.