How about general best practices?
Regarding checking inputs:
I once wrote a big program in a hurry and I wrote all kinds of Guard Clauses, input checks, into my functions. When I ran the program for the first time, the errors from those clauses streamed by so fast I couldn't even read them, but the program did not crash and could be shut down cleanly. It was then a simple matter of going through the list and fixing bugs which went surprisingly fast.
Think of Guard Clauses as run-time compiler warnings and errors.