References in D

Ziad Hatahet hatahet at gmail.com
Fri Oct 5 11:24:28 PDT 2012


On Fri, Oct 5, 2012 at 11:13 AM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> You are going to find plenty of people who disagree quite strongly with
> you.
> There are times when having a type be non-nullable is very useful, but
> there
> are times when having a type be nullable is extremely useful. You seem to
> think that the idea of nullability is bad in the first place, and while
> some
> people will agree with you, a _lot_ will not. You're fighting a losing
> battle
> if you're arguing that.
>
> It would be a _huge_ design mistake for a systems language not to have
> nullable pointers. Having non-nullable references or pointers in addition
> to
> nullable ones might be useful, but not having nullable ones at all would be
> crippling - especially for a systems language.
>
> I think that we're clearly going to have to agree to disagree here.
>
> - Jonathan M Davis
>


I do not think he was arguing removing null completely from the type
system. It is just that for the vast majority of the cases, references are
not meant to be null and thus it should be disallowed by default. If you
want to use a nullable reference you have to explicitly ask for such.

--
Ziad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121005/b716e522/attachment-0001.html>


More information about the Digitalmars-d mailing list