Errors aren't that simple

James Seidman jseidman at jarthur.Claremont.EDU
Fri Mar 2 16:09:17 AEST 1990


In article <470008 at gore.com> jacob at gore.com (Jacob Gore) writes:
>/ comp.lang.c / billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu
>(William Thomas Wolfe, 2847 ) / Mar  1, 1990 /
>>    The [AT&T long distance netrowk] 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.
>
>So what else is new?  In the following Ada code the "exit" will exit the
>loop instead of the 'if' statement:
>[Exactly analogous Ada example deleted]
>In C, 'break' exits switches and loops.  Not ifs.

Of course, part of Bill's point is that anyone who is programming in Ada
will be trained in software engineering and therefore will not make
mistakes.  On the other hand we C programmers are all people who just
graduated from high school and are writing code without any formal
training.

He also has the point that if Unix was rewritten in Ada then it would have
no security holes.  Similarly, if the units(1) utility were written in Ada
it would automatically update currency values.  I might point out, however,
that there is at least one Ada compiler in existence which is itself written
in C, and therefore you should be very wary when using an Ada compiler in
case it's that one.  Now if only the Ada compiler was written in Ada
instead...

By the way, has anybody compared speeds of Ada and C implementations?  I
don't know about other platforms, but on our VMS system an Ada program which
simply prints "Hello World!" on the screen takes eight times longer to
compile than a similar C program, and the executable is 11 times longer in
length.  The execution time appears to be about three times slower as well.
I really think it's time for the Ada community to clean up its act and get
some faster compilers.  

As a parting shot, I will end this post with a list of all of the utilities
on our VMS *and* Unix systems which are written in Ada:

----- beginning of list -----
-----    end of list    -----

Fortunately, thanks to programmers like Bill Wolfe, they are all bug free.
-- 
-------------------------------------------------------------------------------
Jim Seidman, Harvey Mudd College, Claremont, CA 91711.  (714) 621-8000 x2026
DISCLAIMER: I don't even know if these are opinions, let alone those of
            anyone other than me.



More information about the Comp.lang.c mailing list