'with' bug?

Era Scarecrow rtcvb32 at yahoo.com
Sat Nov 3 16:02:29 PDT 2012


On Saturday, 3 November 2012 at 20:29:14 UTC, bearophile wrote:
> Faux Amis:
>
>> Care to elaborate on that?
>
> They share most of the problems of global variables. While not 
> evil, it's better to avoid module-level mutables. This makes 
> the code more testable, simpler to understand, less bug prone, 
> and makes functions more usable for other purposes. In D there 
> the attribute "pure" is present also to enforce such better 
> coding style.

  Let's not forget that since global variables are 'per thread' 
that the issues involving them lessen and are less evil than 
before.


More information about the Digitalmars-d mailing list