'with' bug?
Faux Amis
faux at amis.com
Sun Nov 4 06:59:24 PST 2012
On 03/11/2012 21:29, 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.
>
> Bye,
> bearophile
I failed to mention that I am mostly talking about private module scope
variables. I don't see how private module scoped vars make for less
testable, readable or more bug prone code.
More information about the Digitalmars-d
mailing list