problems/risks due to programming language, stories requested

Bill Leonard bill at ssd.harris.com
Wed Feb 28 06:30:04 AEST 1990


In article <9790 at medusa.cs.purdue.edu> gb at cs.purdue.EDU (Gerald Baumgartner) writes:

   I received the following on AT&T's famous bug (and have deleted multiple 
   forwarding headers):

   | | Subject: AT&T Bug
   | | Date: Fri Jan 19 12:18:33 1990
   | | 
   | | This is the bug that cause the AT&T breakdown
   | | the other day (no, it wasn't an MCI virus):
   | | 
   | | In the switching software (written in C), there was a long
   | | "do . . . while" construct, which contained
   | |    a "switch" statement, which contained 
   | |       an "if" clause, which contained a
   | |          "break," which was intended for
   | |       the "if" clause, but instead broke from
   | |    the "switch" statement.
   | | 

           Again it looks like this bug wouldn't have occurred in another
           programming language.

I can't resist saying that this last statement seems to me to be utter
nonsense.  What programming language (read, compiler) can read the
programmer's mind and tell what he meant?  The use of the "break" statement
was a logic error (actually, it sounds like it was a lack of knowledge of
the language, since "break" does not apply to "if").  I can't imagine a
programming language that could discern this type of error.  [If I use
WHILE instead of IF, for instance, I can expect some things to work and
some not.  Yet I seriously doubt any compiler could possibly detect this
error.]

I certainly think programmers often choose an inappropriate language, but I
shy away from anecdotal stories like these because they seem (to me) to
spread a lot of misinformation.  Unless you implement a project in multiple
languages, it is nothing more than a guess to say what would have happened
if the project had been implemented in some other language.  Perhaps you
would have discovered an even more serious flaw in that language, or you
might simply find it was no better or worse than the one you chose, just
different.

Most of the stories I have heard along these lines all struck me as missing
the point: how well was the program tested?  Were there code reviews?
Design reviews?  All of these techniques are proven to reduce errors.  Most
of the errors in these stories (e.g., the infamous dot-versus-comma one)
should have been found with even rudimentary testing.

Use of an inappropriate language is no excuse for abandoning other techniques
of good software engineering.
--
Bill Leonard
Harris Computer Systems Division
2101 W. Cypress Creek Road
Fort Lauderdale, FL  33309
bill at ssd.csd.harris.com or hcx1!bill at uunet.uu.net



More information about the Comp.lang.c mailing list