Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 12 16:25:56 PDT 2014


>> Automatic code rewriting is what might make syntax deprecations
>> more feasible in 6 month.
>
> Perhaps, but this change is so straightforward that I would 
> expect that even a
> very large codebase could be updated in a very short space of 
> time.

The main counterargument against this change is that it's yet 
another change that require people to rewrite their code.
Also the pull simply deprecates certain code, but for good 
acceptance we also need to educate D users why we're doing this 
change and must make updating code as painless as possible. A 
tool like dfix will become more important with every line of D 
code that is written. Too often we're only looking at phobos.

> it's for a practice that we've already been discouraging for 
> some time now

Never heard of it before. If this were common knowledge, as in 
every D beginner would stumble over that information, it would 
solve half of the problem.
I'd still welcome if someone updated the style guide.

> I see is dmd's headergen, because if that's putting const on 
> the left, then
> it'll generate code that will then be warned about, which would 
> definitely be
> bad. The ddoc generation should be fixed to, but that can be 
> done later,

Obviously we should fix all of our own code and explain people 
why they should update theirs before we start deprecating it.


More information about the Digitalmars-d mailing list