VI

Adversity

When programs execute, abnormal things may happen, either intentionally (by malicious attacks) or unintentionally (by programmer's overlook or unexpected failures in hardware). Dealing with them is perhaps one of the most complicated activities in program design. One approach to dealing with abnormalities is to be oblivious to them. This can be done by either (1) assuming that errors don't occur or (2) not caring if they occur. For the purpose of focusing on specific constraints without distractions, obliviousness is the style followed in this book – except in the next five styles. The next five chapters – Constructivist, Tantrum, Passive Aggressive, Declared Intentions and Quarantine – reect five different approaches to dealing with adversity in programs. They are all instances of a more general style of programming known as defensive programming, which is very much the opposite of the oblivious style. A comparative analysis of the first three variations of defensive programming is presented at the end of Chapter 22.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset