"with" should be deprecated with extreme prejudice

Derek Parnell derek at psych.ward
Sun May 17 21:38:08 PDT 2009


On Sun, 17 May 2009 19:33:35 -0500, Andrei Alexandrescu wrote:

> 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;
> }

I guess the reason for using with() is to avoid typing repetitive stuff.
Would this work instead ...


 int x, y;
 with (p as "somevery.long.struct.or.class[17].name")
 {
      y += p.x;
      ++p.x;
 }

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list