Subject: Re: Theory #51 (superior(?) programming languages)
From: Erik Naggum <erik@naggum.no>
Date: 1997/01/23
Newsgroups: comp.arch,comp.lang.lisp,comp.lang.scheme
Message-ID: <3063010159007887@naggum.no>


* David Hanley
| [modulo 2^n definition of integer types] might seems silly, but I seem to
| remember it as part of the required computer science classes at my
| university, and pretty much everyone got it.  If someone can't be
| bothered to learn basic language 'stuff' I don't know how much I trust
| them as programmers.

obviously, the problems don't happen when programmers are aware of them and
actually code to detect overflow.  the problems happen because programmers
are not aware of the _possibility_ of an overflow in a given operation, and
so calculate and return the wrong answers without any notification or error.

with extreme care and precaution, a C programmer may write explicit code
that detects when the modulo 2^n arithmetic does not agree with expected
mathematical values, but overflow is an _error_ condition.  if a programmer
writes checks after the fact, the _error_ still went unnoticed by C.  you
can add as much explicit code as you want -- C _still_ doesn't give you
access to the overflow condition.

and yes, I _do_ know that what I'm asking for is not C.  please get the
point: C _does_ _not_ _provide_ a necessary mechanism for safe programming.

#\Erik
-- 
1,3,7-trimethylxanthine -- a basic ingredient in quality software.