in reply to Is validation of all subroutine arguments overkill?
Do you think it's worth the time to write tests to ensure subroutines handle bad arguments?
What is the likelihood of a particular subroutine being passed bad arguments?
If those arguments are sourced from data outside of your programs control, and that data will not have passed any other validation before being passed to this subroutine, then validating is not just worth the time, but (IMO) imperative.
On the other hand if the subroutine can only be called with data that has already been validated, its pointless.
|
|---|