O'Reilly logo

New Programmer's Survival Manual by Joshua D. Carter

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

Tip 5Fail Gracefully
White Belt[​​White Belt] Writing code that fails well is just as important as writing code that works well.

What happens when code fails? It’s going to. Even if you wrote your part perfectly, there are all kinds of conditions that could cause the overall system to fail:

  • A rogue mail daemon on computer, busy sending offers of great wealth from some foreign country, consumes all the RAM and swap. Your next call to malloc() returns ETOOMUCHSPAM.

  • Java Update 134,001 fills up the system’s hard drive. You call write(), and the system returns ESWITCHTODECAF.

  • You try to pull data off a tape, but the tape robot is on a ship at sea, rolling waves ...

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