Conditional compilation inside asm and enum declarations
Walter Bright
newshound1 at digitalmars.com
Wed Jul 15 02:56:17 PDT 2009
grauzone wrote:
> The #ifndef NO_DEBUGGING causes the code to be compiled in debugging
> mode, if it isn't explicitly deactivated.
"You, sir, are employing a double negative." -- Mr. Spock
It's not that it's impossible to figure out, it's that it's execrable
style. In my experience, such constructs correlate strongly with
incoherent and buggy code in the sections it appears in, including when
I've used it.
The interesting question is is the construct itself the cause or the
effect of incoherence and bugginess?
I'm asking you to give it a chance. Grep your own code for such. See if
it could be redone without negation, and see if you like that better.
Even so, you *can* use negation in D version statements:
version (NO_DEBUGGING) {} else
{
... debugging is on ...
}
they're just a few more characters than laying down a single ! or n.
Hopefully, they're enough extra effort that one will minimize the use of
them.
More information about the Digitalmars-d
mailing list