Timeline for Validation of the input parameter in caller: code duplication?
Current License: CC BY-SA 3.0
2 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 20, 2013 at 14:33 | comment | added | John R. Strohm | Actually, it may be better to validate the parameter, and, if the parameter is invalid, throw an exception yourself. Here's why: the clowns who call your routine without bothering to make certain they gave it valid data are the same ones who will not bother to check the error return code that indicates they passed invalid data. Throwing an exception FORCES the problem to be fixed. | |
| Feb 20, 2013 at 13:57 | history | answered | superM | CC BY-SA 3.0 |