News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about addresses by mgkimsal on Sunday January 18, 2015 @10:33AM (#8907736)
I got in to an argument in school with my computer programming teacher. A BASIC course, we were having to design a system to accept an address, and I was treating my ZIP code as a string.

IIRC, something like

50 INPUT "Your ZIP code?", ZIP$

Everything was reviewed via handwritten code and flowchart before we were allowed to type it in in the lab, and I was told "ZIP code is a number, but you're putting it in to a string, that's wrong, fix it".

"But a ZIP code starting with 0 would then not have the 0 at the front when we show it back to the user" I said.

"ZIP codes don't start with 0"

Me: "Some do"

Her: "No, they don't"

I lived in Michigan, but was a huge infocom fan, and they were in MA, and had a leading 0 in their ZIP code. We argued about this for a good few minutes, and it wasn't until I brought in something the next day that demonstrated legit ZIP codes starting with 0 that I 'won'. Crap like this reinforced my distrust of authority and cynicism in life (for better or worse).

EDIT: Anyone else remember the "New Zork Times" newsletter? :)

EDIT 2: It wasn't until much later that I learned the ZIP code system we had wasn't actually completely formed until after she was at least a teen, if not a full adult - she simply wasn't exposed to stuff that I was earlier, it didn't really impact her, and she just assumed they were all numbers with no leading 0s. In some ways a minor point, but... it also taught me about stuff I took for granted not always having been there, even something as basic as addresses. Didn't really learn that until much later after that class.

Re:Falsehoods programmers believe about addresses by zaroth on Sunday January 18, 2015 @06:14PM (#8909386)
The worst is when you store it as a string, having learned from others' mistakes, but then upon exporting to CSV... Excel kindly strips the leading 0 and you get a bug report that your software is screwing up the ZIP codes!

Took a bit of searching before finding this: https://www.webdigi.co.uk/blog/2010/handling-leading-zero-in...

Re:Falsehoods programmers believe about addresses by WatchDog on Sunday January 18, 2015 @07:35PM (#8909648)
Excel is the bane of my existence. I give a lot of speeches about how to preserve data precision. However It seems to be largley in vain, as there is often a lot of back and forth when handling data between different groups, even programmers don't seem immune from screwing up a csv file with excel.
Re:Falsehoods programmers believe about addresses by UrMomReadsHN on Monday January 19, 2015 @12:31AM (#8910484)
Oh god office workers love putting everything in Excel. Even when it makes no sense...
Re:Falsehoods programmers believe about addresses by TeMPOraL on Monday January 19, 2015 @09:42AM (#8912081)
Can't blame them. The only other choice they usually have is some crappy, poorly thought "database system" written by IT people who are poster children of this article. I'm a programmer and I defend use of Excel in the offices - I've actually worked in such an office before and I know that all the alternatives suck more.

And I guess that's one of the biggest mistake programmers make - assuming that real-life data will conform to some imaginary, bureaucratic, fixed format. Even schemas ain't fixed in real life. That's why people use Excel.

Re:Falsehoods programmers believe about addresses by mgkimsal on Monday January 19, 2015 @02:37PM (#8913615)
The other awesome is taking a screenshot, pasting it in to MS Word, then mailing the docx file. The entire screenshot then ends up being 3 inches across.
Re:Falsehoods programmers believe about addresses by TazeTSchnitzel on Sunday January 18, 2015 @11:44PM (#8910378)
I remember when we did MS Access basics in my ICT class in what Americans would call middle school, and my teacher correctly mentioned that a telephone number is text, not a number. :)
Re:Falsehoods programmers believe about addresses by a3n on Sunday January 18, 2015 @11:06AM (#8907819)
"I am the authority in these matters."

" Why?"

"Because I am in authority."

Re:Falsehoods programmers believe about addresses by ghaff on Sunday January 18, 2015 @12:46PM (#8908136)
>EDIT: Anyone else remember the "New Zork Times" newsletter? :)

Yep. I went to school with a bunch of the Infocom guys and was an unofficial beta tester for them at one point.

Re:Falsehoods programmers believe about addresses by mgkimsal on Sunday January 18, 2015 @01:13PM (#8908232)
did they have any clue how groundbreaking their stuff was at the time?
Re:Falsehoods programmers believe about addresses by Retra on Sunday January 18, 2015 @04:05PM (#8908879)
People really need to learn the difference between ordinal, cardinal, and nominal numbers... And what 'semantics' are.
Re:Falsehoods programmers believe about addresses by onion2k on Sunday January 18, 2015 @11:50PM (#8910393)
Are ZIP codes actually number? I'd say they're really numeric strings, and should be handled as strings.