O'Reilly logo

Code Craft by Pete Goodliffe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. TO ERR IS HUMAN

Dealing with the Inevitable— Error Conditions in Code

We know that the only way to avoid error is to detect it, that the only way to detect it is to be free to enquire.

J. Robert Oppenheimer

At some point in life, everyone has this epiphany: The world doesn't work as you expect it to. My one-year-old friend Tom learned this when climbing a chair four times his size. He expected to get to the top. The actual result surprised him: He ended up under a pile of furniture.

Is the world broken? Is it wrong? No. The world has plodded happily along its way for the last few million years and looks set to continue for the foreseeable future. It's our expectations that are wrong and need to be adjusted. As they say: Bad things happen, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required