comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Have you ever had a bug caused by...
Date: Mon, 22 Oct 2001 18:14:22 -0400
Date: 2001-10-22T22:14:24+00:00	[thread overview]
Message-ID: <9r25o0$fla$1@nh.pace.co.uk> (raw)
In-Reply-To: usncbuz01.fsf@ctwd0143.fitlinxx.com

The point is fair, but usually what gets considered a "Bug" is something
that makes it out of development and is discovered during some kind of
formal test or into a fielded system. The developer going through the
edit-compile-link-run development cycle and generating an error in the
process doesn't really count as a "defect" in the end product.

I understand what you are saying: Ada programmers can still make the same
mistakes in coding that C programmers can make. But the point is that those
errors may not get past the compiler and/or the initial execution fo the
code.

There is also an advantage to getting some kind of runtime exception in a
fielded system as well. If an index gets out of range under unusual
conditions not tested for, yes this is a programmer error. But unlike
silently running off the end of an array and scrogging memory with possibly
non-fatal, yet serious problems being generated, Ada is going to halt the
code and (if the implementation is nice!) report where it stopped and why.
In most apps that is *usually* a good thing.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"David Bolen" <db3l@fitlinxx.com> wrote in message
news:usncbuz01.fsf@ctwd0143.fitlinxx.com...
> mjsilva697@earthlink.net (Mike Silva) writes:
>
> > While discussing (er, pushing) Ada with some C-coding co-workers today
> > I asked a question to which I knew the answer (always the best kind!):
> >  "Have you ever had a bug caused by accessing off the end of an
> > array?"  Well, of course, they all had to say yes.  Then I started
> > thinking of other bugs that they would have to admit to, and which
> > wouldn't occur in Ada.  Nothing new here (Ada prevents many bugs...),
> > but I thought it would be fun and useful to develop a group list as an
> > Ada advocacy tool.  For example:
>
> I'm curious as to how Ada _prevents_ such bugs.  Are you saying that
> no Ada programmer has ever had a bug caused by walking off the end of
> an array either?
>
> I'll buy that Ada will catch that error more quickly than in C, and
> probably help isolate the problem more quickly.  And even that by
> using attributes such as Range, Low and High that you can write more
> robust code to avoid the issue (which is no small benefit).  But given
> that you can still compute indices and then attempt to dereference
> based on those computations, there has to be the occasional bug that
> is introduced through the use of indices that overflow the array.
>
> And that's different from saying "wouldn't occur in Ada" ... there's a
> difference between better handling of the bug, and not having the bug
> ever occur.  Or to put it another way, if I have a bug that creates
> this condition (or say, tries to set a value outside its range, as in
> another example), generating an exception - even if handled - still
> implies the bug exists.
>
> Some of the suggested items appear to be language checks that are
> completely possible at compile time, for which I'd buy the "can't
> happen" argument.  But any issues that can occur at runtime and
> require runtime checks and exceptions don't, IMHO, prevent bugs, but
> simply act to make it easier to diagnose and manage them when they do
> occur.
>
> --
> -- David
> --
> /-----------------------------------------------------------------------\
>  \               David Bolen            \   E-mail: db3l@fitlinxx.com  /
>   |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
>  /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
> \-----------------------------------------------------------------------/





  reply	other threads:[~2001-10-22 22:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-20  1:14 Have you ever had a bug caused by Mike Silva
2001-10-20  1:44 ` Larry Kilgallen
2001-10-20  2:12   ` James Rogers
2001-10-20  9:15     ` Robert*
2001-10-20 11:20       ` Bertrand Augereau
2001-10-20 11:30         ` Matthew Woodcraft
2001-10-20 12:39           ` Robert*
2001-10-20 13:09           ` Bertrand Augereau
2001-10-20 21:21         ` Robert Dewar
2001-10-22 15:58     ` Ted Dennison
2001-10-20 19:07 ` Dr Adrian Wrigley
2001-10-21  1:09   ` Mike Silva
2001-10-21 12:05     ` Larry Kilgallen
2001-10-22 14:48 ` Marin David Condic
2001-10-22 17:03   ` Martin Dowie
2001-10-22 17:22     ` Marin David Condic
2001-10-23  6:13   ` Mike Silva
2001-10-22 21:49 ` David Bolen
2001-10-22 22:14   ` Marin David Condic [this message]
2001-10-23  0:52     ` Robert*
2001-10-23 13:30       ` Marin David Condic
2001-10-25  9:45         ` John English
2001-10-25 15:23           ` Marin David Condic
2001-10-25 18:17             ` Ted Dennison
2001-10-25 15:36           ` Ted Dennison
2001-10-25 16:09       ` Simon Wright
2001-10-25  2:16     ` David Bolen
2001-10-23  6:26   ` Mike Silva
2001-10-23  9:40     ` mike
2001-10-23 10:09       ` Preben Randhol
2001-10-23 13:48         ` Marin David Condic
2001-10-23 15:45           ` Ted Dennison
2001-10-23 17:08             ` Marin David Condic
2001-12-04 11:09               ` Harri J Haataja
2001-10-24 12:44             ` Marc A. Criley
2001-10-24 18:55               ` Jeffrey Carter
2001-10-24 19:34                 ` Marin David Condic
2001-10-26  4:18                   ` (Off topic:) Quality Anders Wirzenius
2001-10-25  9:36 ` Have you ever had a bug caused by John English
2001-10-25 15:41   ` Wes Groleau
2001-10-25 17:57     ` Have you ever had a bug OOPS Wes Groleau
2001-11-13  2:07       ` David Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox