comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: not null
Date: Wed, 4 Mar 2009 17:47:03 -0800 (PST)
Date: 2009-03-04T17:47:03-08:00	[thread overview]
Message-ID: <75e0862b-cb8d-4f47-b55e-e2c6235997ea@n33g2000pri.googlegroups.com> (raw)
In-Reply-To: qcauq45pgq84rvntrggh90hdd68ji6btl2@4ax.com

On Mar 4, 5:32 pm, Brian Drummond <brian_drumm...@btconnect.com>
wrote:
> On Wed, 4 Mar 2009 08:09:56 -0800 (PST), Adam Beneschan <a...@irvine.com> wrote:
> >On Mar 4, 6:56 am, Hyman Rosen <hyro...@mail.com> wrote:
> >> Georg Bauhaus wrote:
> >> > As said to have been seen on /.
> >> > another financial disaster, again caused
> >> > by making references to nothing, in Algol W,
> >> >http://qconlondon.com/london-2009/presentation/Null+References:+The+B...
>
> >> You are misreading the abstract. First of all, it's not
> >> about some particular incident. He's talking about the
> >> overall impact. Second, he's not talking about failure
> >> to check for null references, he's talking about having
> >> null references at all, so Ada is no better.
>
> >I'm having difficulty understanding the point.  You have to have the
> >idea of the lack of a reference.  How else would you implement a
> >linked list abstraction?
>
> Possibly by pointing from the end back to the list head.
>
> It would make the "end of list" test more expensive (the head might have to be
> kept in a register or passed around as another argument). I don't think it would
> be pretty, but can't see any fundamental reason why it shouldn't work.

Sure you could make it work, but what would be the point of doing so?
And would it be any less error-prone?  Actually, it might even be
moreso---when writing the operation to insert an element at the front
of the list, you could forget to modify the reference in the tail.

To me, a circular list and a linked list that isn't circular are two
different abstractions (perhaps they have different topological
properties, in some sense).  Forcing one to be implemented as the
other is hardly a recipe for making programs more reliable.

You could also make the "end of list" point to some special dummy
object.  That would probably be better than forcing the list to be
circular, but again just as pointless.  I believe my earlier comment,
that the same set of mistakes applies as to a language that involves
null reference, but the syntax of those mistakes is different, applies
to both of these "solutions".

                               -- Adam





  reply	other threads:[~2009-03-05  1:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-04 14:44 not null Georg Bauhaus
2009-03-04 14:56 ` Hyman Rosen
2009-03-04 15:22   ` Georg Bauhaus
2009-03-04 16:16     ` Adam Beneschan
2009-03-05 14:24       ` Georg Bauhaus
2009-03-05 16:07         ` Adam Beneschan
2009-03-06  1:07       ` Hibou57 (Yannick Duchêne)
2009-03-04 16:09   ` Adam Beneschan
2009-03-04 20:38     ` Dmitry A. Kazakov
2009-03-05  1:54       ` Adam Beneschan
2009-03-05  8:42         ` Dmitry A. Kazakov
2009-03-05  1:32     ` Brian Drummond
2009-03-05  1:47       ` Adam Beneschan [this message]
2009-03-05 11:32         ` Brian Drummond
2009-03-05 15:06           ` Dmitry A. Kazakov
2009-03-05 13:57         ` Georg Bauhaus
2009-03-05 19:53       ` Jack Mitchell
2009-03-05  8:49     ` Jacob Sparre Andersen
2009-03-05 16:10       ` Adam Beneschan
2009-03-05 17:20         ` Jacob Sparre Andersen
2009-03-06  1:04     ` Hibou57 (Yannick Duchêne)
2009-03-06 12:01     ` Harald Korneliussen
2009-03-06 12:43       ` Jacob Sparre Andersen
2009-03-06 13:05         ` Harald Korneliussen
2009-03-06 15:21       ` Dmitry A. Kazakov
2009-03-06 16:59         ` Harald Korneliussen
2009-03-06 17:48           ` Dmitry A. Kazakov
2009-03-06 20:05             ` Georg Bauhaus
2009-03-06 21:31               ` Dmitry A. Kazakov
2009-03-04 16:19   ` Robert A Duff
2009-03-04 20:39 ` Colin Paul Gloster
replies disabled

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