Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site dartvax.UUCP
Path: utzoo!linus!decvax!dartvax!chuck
From: chuck@dartvax.UUCP (Chuck Simmons)
Newsgroups: net.arch
Subject: Re: how to handle range checking
Message-ID: <3638@dartvax.UUCP>
Date: Mon, 30-Sep-85 15:18:18 EDT
Article-I.D.: dartvax.3638
Posted: Mon Sep 30 15:18:18 1985
Date-Received: Wed, 2-Oct-85 21:08:37 EDT
References: <796@kuling.UUCP> <2580002@csd2.UUCP> <191@graffiti.UUCP> <1668@peora.UUCP>
Organization: Dartmouth College, Hanover, NH
Lines: 16

> > What should the code do when a range-check occurs?  Print out an error
> > message on ticker-tape & hang?  Do nothing?  A better analogy, perhaps,
> > would be...

The real advantage to range checking comes when you are debugging and testing
your program.  With range checking, bugs in the code become immediately
apparent.  Without range checking, the code may run for quite some time
before it becomes obvious that something is terribly wrong.

When an error condition does occur, the program should abort as cleanly
and quickly as possible leaving as much information as it can for its
programmer to figure out what went wrong.  For some programs, it may be
possible to return to some known state and then continue processing.

-- chuck