Defensive Programming and Error-handling: The Path Less Travelled
Tracy Sherman, Angela Ringelberg · 2013
Defensive programming detects logic errors by determining whether the code represents a proper implementation of the specifications. Thus, defensive programming is a prospective approach that anticipates logic errors, even those not yet discovered. Once a logic error is identified, messages are written to the SAS log and, possibly, additional diagnostics commences. The process emulates a thought experiment that reduces logic errors. This paper explains defensive programming and error-handling techniques based on the implementation of CDISC ADaM (analysis) data sets, which can be easily extended to other programming tasks.