Sir Antony "Tony" Hoare, 1980
People keep inventing new ways of validation, and that's really good! The problem is when they want them all in the whole same form!
[This link] provides an example I have elaborated about what I have called "Validation Overkill."
I will list some overkill principles:
- State validation constraints, before, while and after:
before: by using a label, and description of the time of data and its formatting
while: show errors while typing data, or when changing focus, with Javascript or AJAX
after: it's normal that back-end rejects wrong data - Indicate validation errors. It's normally done by adding a red color to a data field
- List a summary of errors with anchor links to data fields, normally at the top of the form.
- Retell errors, just like the while part of validation constraints.
Javascript problems: visibility, library size, duplication of validation code, excesive AJAX
- Javascript code is visible
- if libraries are big, they will take time to be downloaded
- sometimes it's needed to validate twice: front-end and back-end
- excessive ajax requests can kill bandwidth
- If your user base is big, it will be a load for your server
- AJAX is a process running on back-end, not in the browser.
- You would like to squeeze the total capability of the machine, but
- sometimes to pay for a CPU upgrade, or
- to buy an extra CPU to use as replication could be a faster way to solve latency
- because all these rules are present in every field of an input form,
- and specially if those fields are required
No hay comentarios:
Publicar un comentario