Blog post: What D got wrong

Pjotr Prins pjotr.public12 at thebird.nl
Tue Dec 18 10:36:15 UTC 2018


On Thursday, 13 December 2018 at 18:29:39 UTC, Adam D. Ruppe 
wrote:
> 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.

Isn't it the way forward that the compiler deduces these 
attributes and fills them in automatically? All these can be 
inferenced. Only when the caller wants to guarantee, say pure, it 
could add it explicitly. I read somewhere that the compiler 
already does this to some degree. And even the generated docs 
should be able to show it.


More information about the Digitalmars-d-announce mailing list