comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: not null
Date: Wed, 04 Mar 2009 11:19:46 -0500
Date: 2009-03-04T11:19:46-05:00	[thread overview]
Message-ID: <wccljrlz2e5.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: KEwrl.43389$EO2.26870@newsfe04.iad

Hyman Rosen <hyrosen@mail.com> writes:

> 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+Billion+Dollar+Mistake
>
> You are misreading the abstract. First of all, it's not
> about some particular incident. He's talking about the
> overall impact.

Yes.  (I think Georg Bauhaus understood that.)

>... 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.

There's nothing wrong with allowing programmers to use null pointers.

There's a lot wrong with giving programmers a null value for all
pointer types, whether they're wanted or not.  It's just a tripping
hazard.

Ada is a little bit better than languages that always allow null,
because it allows you to declare "not null" on an access [sub]type.
It would be even better if "not null" were the default -- ideally,
you should get a null value only if you ask for it explicitly.
It's too late to fix it now.

Ada is also better than languages that say deref of null leads to
unpredictable behavior.  At least you get a run-time error in Ada.
But it's still a tripping hazard.

See OCaml for a language that gets this right.

- Bob



  parent reply	other threads:[~2009-03-04 16:19 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
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 [this message]
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