Blog post: What D got wrong

Pjotr Prins pjotr.public12 at thebird.nl
Tue Dec 18 13:35:34 UTC 2018


On Tuesday, 18 December 2018 at 11:25:17 UTC, Jonathan M Davis 
wrote:
> Of course, even if we _did_ have a solution for reversing 
> attributes, slapping an attribute on the top of the module 
> would still potentially be a maintenance problem, because it's 
> then really easy to miss that an attribute is in effect (it's a 
> problem that we've had on several occasions with druntime and 
> Phobos in the few cases where attributes are mass-applied). So, 
> there is no silver bullet here (though regardless of whether 
> mass-applying attributes is something that should ever be 
> considered good practice, we really should add a way to be able 
> to reverse them).

Thanks Jonathan for your elaborate explanation. I personally have 
no problem with the attributes which - in practice - means I 
don't use them much unless I want to make sure something is nogc, 
for example. For library designers it makes sense to be explicit. 
I guess that is where the trade-off kicks in. Maybe it is just a 
feature. We argue against specifying them because other languages 
are not as explicit. It does add a little noise.


More information about the Digitalmars-d-announce mailing list