Code as if someone’s life depended on it.

Message for the day…

A useful technique I use to reduce the number of bugs in my buggy programs is to code as if someone’s life depended on them. When “it doesn’t matter,” it’s easy to avoid adding all the error checking.

But once you start looking at code as if it was mission critical, you start to see things differently and begin adding “useless” error checking. As long as you can afford the extra few moments to add the “useless” error checking, and as long as you have code space to hold the “useless” error checking, and as long as you have enough CPU cycles to run the “useless” error checking, you end up with a program that should be better,

Share and enjoy.

1 thought on “Code as if someone’s life depended on it.

  1. MiaM

    I totally agree… Except don’t stop the program execution if the error happens in a non-critical part. Thinking about Ariane 5… :)

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.