"with" should be deprecated with extreme prejudice

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 17 21:30:58 PDT 2009


Rainer Deyke wrote:
> Andrei Alexandrescu wrote:
>> In a member function there's no need to prefix each member.
> 
> There isn't, but there should be.  IMO.
> 'with' should be banned.
> Implicit access to members of 'this' should also be banned.  I always
> use explicit 'this->' in C++ and explicit 'this.' in D.  It makes the
> code much easier to read.

You see, this is an interesting point. Not using "this." may lead to 
local bugs. The masking effected by "with" may lead to nonlocal bugs. 
The difference in risk is enormous.


Andrei



More information about the Digitalmars-d mailing list