Blog post: What D got wrong

Adam D. Ruppe destructionator at gmail.com
Thu Dec 13 18:29:39 UTC 2018


On Thursday, 13 December 2018 at 10:29:10 UTC, RazvanN wrote:
> Do you honestly think that they will ever take D into account 
> if @safe and immutable data will be the default?

D needs to stop chasing after what you think people think they 
want and just start being good for us.

The majority of my code is written pretty permissively - I like 
my pointers, my gotos, my GC, my exceptions. But I'm willing to 
consider the change because I actually don't think it will be 
that big of a hassle, and will be better overall. I wanna show 
you something:

/// Static convenience functions for common color names
nothrow pure @nogc @safe
static Color transparent() { return Color(0, 0, 0, 0); }


The attribute spam is almost longer than the function itself. And 
I don't even personally care - I only put those in because some 
library user who did care filed a bug report, and that was before 
I would answer those with "WON'T FIX. D's attributes are a 
misdesigned waste of time. You shouldn't bother with them either"


If the defaults were swapped though, that would just work. Both 
for me and for my library users. And that is worth looking at.


Though, I think we could also get a lot of mileage out of fixing 
two glaring problems with the status quo: 1) making attr: at the 
top descend into aggregates consistently and 2) LETTING US TURN 
THEM OFF. SERIOUSLY WHY DON'T WE HAVE `virtual`, `throws`, 
`impure` AND THE REST?! THIS IS SO OBVIOUS AND THE LACK OF THEM 
IS UNBELIEVABLY FRUSTRATING.


More information about the Digitalmars-d-announce mailing list