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

Brad Anderson via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 10 11:11:41 PDT 2014


On Friday, 10 October 2014 at 17:52:30 UTC, Steven Schveighoffer 
wrote:
> I think leaving this to a lint tool basically is as good and 
> effective as doing nothing. It's not a compromise at all.

I agree. The only people who run lint tools are established users 
(because they are the only ones who even know they exist). 
Established users are already well aware of how to use function 
attributes correctly (and for the most part did left-hand 
attributes in old code written before the informal convention 
came about).

left-hand const is primarily a problem for new users of the 
language (particularly the large amount coming from C++). These 
users aren't running linters, they are still just trying to get 
basic projects off the ground. This issue is one of the top 
things I see new users have problems with in the D IRC channel. 
You can find new users having problems with it on Stack Overflow 
too.


More information about the Digitalmars-d mailing list