Errors aren't that simple

Emuleomo emuleomo at paul.rutgers.edu
Thu Mar 8 01:43:43 AEST 1990


In article <17000003 at hpcvra.CV.HP.COM>, frankw at hpcvra.CV.HP.COM (Frank Wales) writes:
> In some article (William Thomas Wolfe, 2847 )
>  billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu writes:
> >From ekrell at ulysses.att.com (Eduardo Krell):
> >> And what makes you think the network wouldn't have crashed if the software
> >> had been written in Ada (you seem to imply this)? Do you know the details
> >> of the cause of the crash?. 
> 
> >   The crash apparently was caused by a programmer who used a "break"
> >   within an if (which itself was within a switch) for the purpose of
> >   exiting the if; the real result was to exit the switch instead.  If
> >   C provided a case statement rather than a switch..break system, then
> >   the error would most likely have been prevented.
> 
> Well, actually, the crash was caused by software which didn't work

Actually, I think the 'break' as used in the switch stmt was one of the few
mistakes Dennis Ritchie made when designing the C language. By using
'break' both to end a 'case', and to exit a loop, he overloaded the meaning of
'break' and thus made it impossible to jump out of a switch that is embedded
within a loop without using a flag or a GOTO!
Was he trying to conserve keywords? In hindsight, I think 'endcase' would have 
been a better choice.
The other less serious flaw in C is the do...while contruct.
I kind of prefer PASCAL's repeat....until construct myself.
Anyway, 1.5 flaws in a language is still pretty good. I have used several 
languages ( >15) and in expressive power, it is difficult to beat C.
Thats why its fast becoming the lingua franca of programming.

--Emuleomo O.O. (emuleomo at yes.rutgers.edu)
-- 
** The ONLY thing we learn from history is that we don't learn from history!



More information about the Comp.lang.c mailing list