[Tutor] Should error checking be duplicated for both functions if one function calls another one?

boB Stepp robertvstepp at gmail.com
Mon Jun 1 16:27:07 CEST 2015


Suppose in a given state of a program, function 1 calls function 2.
Function 1 includes checks for possible error conditions. If there are
no issues, then function 2 should execute with no issues as well. The
question is, should function 2 include the error checking done in
function 1 if function 2 is only ever called by function 1?

My inclination is to say yes, as in some future incarnation of the
program function 2 might get called in new ways. What are your
thoughts?

-- 
boB


More information about the Tutor mailing list