3 ms·
These "Falsehoods programmers believe about XYZ" sites are interesting and all, but the practical take away always seems to be: "In order to handle all of thes
by ryandrake 13y ago
These "Falsehoods programmers believe about XYZ" sites are interesting and all, but the practical take away always seems to be:
"In order to handle all of these clever edge cases, your [Time|Date|Name|Address|Gender] handling code should be 2,000 lines long, not 2 lines long."
Which is not very helpful if you're just trying to get your product out. Sure, you could take another week to make sure you handle that hamlet in Macedonia whose name isn't a text string, but then again, why not just slap in "address" "city" "state" and "zip" fields and get on with the rest of your actual product? The naive solution covers pretty much all of the USA market. Hell, call those last two "state/province" and "zip/postcode" and you've got most of the world handled. Fix the edge cases in V2, if you even have to.
- Marazan 13y agoI think you're getting the wrong take away from these articles. The message is that the real world is messy so don't spend 2000 lines of code trying to validate it to a strict (simplistic) model. For example my bank's website couldn't deal with the fact that my street address was (representative example) "5/3 Hawthorn Street" because the '/' was an illegal character (as was -,: and a whole bunch of other separators I tried) - but that's how it appears in the Post Office's database. Some programmer has spent effort to implement the code to reject my legal (and incredibly common) style of address. It would have been far less effort not to have done that. By contrast the DVLA website just gives you a free input text area, perfect. Minimal effort for them, zero hassle for me.