D - Unsafe and doomed

Walter Bright newshound2 at digitalmars.com
Sat Jan 4 16:16:41 PST 2014


On 1/4/2014 2:41 PM, Chris Cain wrote:
> On Saturday, 4 January 2014 at 22:36:38 UTC, Walter Bright wrote:
>> No, I am not defending it. I am pointing out that there's excessive emphasis
>> on just one hole in that cheesegrater.
>
> I think that's because it's the one "hole in the cheesegrater" that matters to
> most people. A non-null constraint has an effect on a lot more code than a "must
> be prime" constraint, for instance.

If you look at code carefully, you'll see that most usages of types are 
constrained. Not only that, an awful lot of types have an "invalid" value, which 
is used to denote an error or missing data. The classic would be the -1 values 
returned by many C int returning functions. Using those without checking first 
doesn't even give the courtesy of a seg fault.

I think a solution that potentially plugs all the holes in a cheesegrater rather 
than only one would be better.


More information about the Digitalmars-d mailing list