Content deleted Content added
mNo edit summary |
No edit summary |
||
Line 24:
name of this file, like "/etc/../etc/passwd".
----
Preconditions, Postconditions and Invariants are also part of Defensive Programming. This may involve checking arguements to a function or method
for validity, doing a check of object state (in OO languages) or other held
data and the return value just before returning or throwing exceptions or error codes. It is preferrable to throw exceptions as messages instead of returning
values that a client programmer is likely to be unprepared for. Within functions, you may want to double check that you aren't referencing something
that is not valid (ie: null) and that array lengths are valid before referencing
elements with indexes.
-------------------------------------
|