How does D handle null pointers?

Jonathan M Davis jmdavisprog at gmail.com
Fri Aug 20 17:05:08 PDT 2010


On Friday, August 20, 2010 16:30:55 dsimcha wrote:
> == Quote from Jonathan M Davis (jmdavisprog at gmail.com)'s article
> 
> > There are
> > quite a few people who want Walter to put in null checks in at least
> > debug mode, but he's against it and no one has been able to convince
> > him. So, as far as null goes, you're in essentially the same boat as
> > you're in in C and C++, which is a major step back in comparison to C#
> > or Java, much as a lot of the rest of D is a step forward.
> > - Jonathan M Davis
> 
> I completely agree that null checks belong in debug mode, but whoever
> thinks they belong in release mode as you imply has absolutely no concept
> of what it means to be a systems programming language.  If somehow null
> checks ended up in release mode, I'd fork the language over it because it
> would be way too much performance overhead for a systems language when I
> didn't ask for it.

I'm not really for putting them in release mode - if nothing else because, as 
you say, D is a systems language. I could see there being cause for a flag which 
makes it so that they're included in release mode, but that certainly shouldn't 
be the default. The complete lack of null checks is horrible for debugging, and 
pretty much anyone coming from a Java or C# background is likely to be rather 
shocked that they're not there. So, I think that we're pretty much in agreement 
on the matter.

- Jonathan M Davis


More information about the Digitalmars-d mailing list