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
From a good-coding standpoint, do you think there is a difference
between these two options?
--
module a;
int a;
--
module b;
struct S{//otherwise unused wrapper
static int b;
}
--