What are the worst parts of D?

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 21 15:39:11 PDT 2014


On Sun, Sep 21, 2014 at 08:27:56AM +0000, ponce via Digitalmars-d wrote:
> On Saturday, 20 September 2014 at 12:39:23 UTC, Tofu Ninja wrote:
> >
> >What do you think are the worst parts of D?
> >
> 
> Proper D code is supposed to have lots of attributes (pure const
> nothrow @nogc) that brings little and makes it look bad.

To be fair, though, hindsight is always 20/20. Had we known earlier that
we would have these attributes, they would've been default to begin
with, and you'd have to explicitly ask for impure / mutable / throwing /
@withgc.

But on the positive side, the compiler will automatically infer
attributes for template functions, and lately I've been tempted to write
templated functions by default just to get the attribute inference
bonus, even if it's just translating fun(a,b,c) to fun()(a,b,c). The
caller site never has to change, and the function is never instantiated
more than once -- and you get the added bonus that if the function is
never actually called, then it doesn't even appear in the executable.

Attribute inference is the way to go, IMO. Research has shown that
people generally don't bother with writing properly-attributed
declarations -- it's too tedious and easily overlooked. Having "nicer"
attributes be the default helps somewhat, but attribute inference is
ultimately what might actually stand a chance of solving this problem.


T

-- 
"Holy war is an oxymoron." -- Lazarus Long


More information about the Digitalmars-d mailing list