Defensive Programming

Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software. The idea can be viewed as reducing or eliminating the prospect of Murphy's Law having effect. Defensive programming techniques are used especially when a piece of software could be misused mischievously or inadvertently to catastrophic effect.

Defensive programming is an approach to improve software and source code, in terms of:

  • General quality - Reducing the number of software bugs and problems.
  • Making the source code comprehensible - the source code should be readable and understandable so it is approved in a code audit.
  • Making the software behave in a predictable manner despite unexpected inputs or user actions.

Read more about Defensive Programming:  Secure Programming

Famous quotes containing the words defensive and/or programming:

    Stay-at-home mothers, . . . their self-esteem constantly assaulted, . . . are ever more fervently concerned that their offspring turn out better so they won’t have to stoop to say “I told you so.” Working mothers, . . . their self-esteem corroded by guilt, . . . are praying their kids turn out functional so they can stop being defensive and apologetic and instead assert “See? I did do it all.”
    Melinda M. Marshall (20th century)

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)