Skip to main content

Defensive Programming

  • Chapter
  • First Online:

Abstract

By June 1949 people had begun to realize that it was not so easy to get a program right as had one time appeared. I well remember when I was trying to get working my first non-trivial program [in assembler code or perhaps machine language]. The realization came over me with full force that a good part of the remainder of my life was going to be spent in finding errors in my own programs. Turing had evidently realized this too, for he spoke at the conference on “checking a large routine.”—Maurice Wilkes (Turing Award winner, 1967), Memoirs of a Computer Pioneer (MIT, 1985), page 145.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    Placing too many error traps in a function can obscure what the function is supposed to do. In that case, sometimes, the traps should be moved into their own function.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Michael Stueben

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Stueben, M. (2018). Defensive Programming. In: Good Habits for Great Coding. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3459-4_11

Download citation

Publish with us

Policies and ethics