"with" should be deprecated with extreme prejudice

BCS none at anon.com
Sun May 17 19:58:51 PDT 2009


Hello Andrei,

> I think "with" is a very dangerous feature due to the way it hides
> symbols. It essentially makes the feeblest attempt at modular
> reasoning utterly impossible:
> 
> int x, y;
> with (whatever)
> {
> y += x;
> ++x;
> }
>
> Maintenance of any type that is being used with "with" becomes a very
> dangerous proposition because it can silently change meaning of code.

I'd be willing to go the half way solution of making accessing a shadowing 
symbol an error, resulting in (loudly) not being able to access either. 





More information about the Digitalmars-d mailing list