I have noticed a pattern in web development when integrating web services: there is an unreasonable faith in the data returned by APIs.
Especially if that API was written or managed by the customer. Web Dev's appear to have forgotten about GIGO (Garbage In, Garbage Out)
So I would add to this post: assume the input is broken
XML will be malformed. Check for it.
Do your own maths, don't rely on a calculated sum
Dates will be American instead of ISO. In fact, use a date picker for user input. Type check input on the front end.
Customer data need to be uploaded to your server? Ok then, zero-bytes files are a Thing.
There will be characters that are non-UTF-8.
There are so many ways to fail. Check your input and handle bad data gracefully and loudly. Don't assume your input will never be bad
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have noticed a pattern in web development when integrating web services: there is an unreasonable faith in the data returned by APIs.
Especially if that API was written or managed by the customer. Web Dev's appear to have forgotten about GIGO (Garbage In, Garbage Out)
So I would add to this post: assume the input is broken
XML will be malformed. Check for it.
Do your own maths, don't rely on a calculated sum
Dates will be American instead of ISO. In fact, use a date picker for user input. Type check input on the front end.
Customer data need to be uploaded to your server? Ok then, zero-bytes files are a Thing.
There will be characters that are non-UTF-8.
There are so many ways to fail. Check your input and handle bad data gracefully and loudly. Don't assume your input will never be bad