This isn&#x27;t always about data integrity.<p>I&#x27;m an American, but I live in the UK: My <i>home address</i> is in the UK, but I live in a flat and my neighbours are mail stealing cunts so I use a scan+email service for my <i>mailing address</i> which is based in the US.<p>Similarly, my <i>land line</i> is a UK number, but my <i>mobile</i> is a US number, and when you refuse to let me type in a `+` sign I spend a lot of energy guessing whether to give you a number in NANP or in international formats.<p>The thing is, capturing information is just that: capture. By doing the traditional programmer thing of validating the field on input, you&#x27;re pissing me off as a potential consumer. I <i>guarantee</i> that I know more about where I live than you do, so I&#x27;m more likely to abort my transaction if you tell me that my address is invalid. That means your non-profit arts association simply doesn&#x27;t get my donation.<p>Thing is, I actually accept that my situation is exceptional and not the rule, so I think this is really about programmers being unable to deal with exceptions; treating them as nothing more than dynamic escapes or nonlocal goto, like there&#x27;s only a choice of more complexity, or more rigidity.<p>This is nonsense.<p>Simply capture whatever the user types. That means all input fields are plain text or blobs or whatever. You can try to validate it into your business model when you have some business need: like mailings, or shipping, and then attempt to extract and validate <i>the specific fields</i> when applying the mapping. If you have an array of failures, you can allow the user to review at that point.<p>I do this with two tables: An input table, and a data table. The input table has forward pointers to the data that is extracted, and the data table has backwards pointers to the inputs. The data tables might be used for business logic like mailings, order processing, login management, or shipping things.<p>Shipping is a particularly good example: I want to maintain four shipping providers since they offer different rates. This allows me to offer &quot;free shipping&quot; by simply selecting the cheapest provider and pushing that cost into the product. To do this I need to know their shipping zip code for the US, or the shipping country for international <i>that&#x27;s it</i>. I don&#x27;t need anything else, and three patterns (&#x2F;(\d{5})(?:-\d{4})&#x2F;, &#x2F;\b([A-Z]{2}$)&#x2F;m, and maybe a list of common countries) should be enough to extract from most orders. Anything else I can punt to my fulfilment center who can either call the potential customer, delete as spam, or manually extract.<p>Or maybe I just ship everything UPS: I send it off to label making, and the 0.003% that fail I have to hand-check anyway (after all, are we verifying the city names as well?)<p>What am I doing with these URLs? Am I visiting them? Am I verifying someone has placed some widget on there? Or am I putting a link next to their name on a bulletin board? Verification means different things depending on the use case.<p>Missing that crucial email address field? Or maybe there&#x27;s an extra space on it? What exactly am I doing emailing them? What if the email bounces? What if it gets marked as spam? Verification of an email address has less to do with the characters in it than it has to do with the use-case: If this is for an account recovery, I want to know you can email me and will work with your system to do that.<p>This approach also means I don&#x27;t need to &quot;edit&quot; things either, because edits are simply new inputs. Logging is free. Users are happy.<p>The point is it&#x27;s not a balance; avoiding the illusion is easier than you think and the hardest parts of the problem of data validity are problems you have to solve anyway.