version and debug statements

pragma pragma_member at pathlink.com
Thu May 11 13:53:33 PDT 2006


In article <e404lr$29ri$1 at digitaldaemon.com>, Walter Bright says...
>
>Sean Kelly wrote:
>> While preprocessor logic has proven to be an aboslute nightmare in terms 
>> of readability and maintainability in some cases, I truly believe that 
>> this is more attributable to a lack of programmer skill than anything 
>> else.
>
>Over time, I've been rewriting my use of #ifdef's in C++ to use the D 
>style, and the results are worth it.

Walter, I mean no disrespect here, but I simply must ask: Are you talking about
a literal interpretation of version() and debug(), including the lack of an
#ifndef equivalent?  

Like this:

#ifdef FOOBAR
#else
/*** code ***/
#endif

Or like this (using ifndef):

#ifndef FOOBAR
/*** code ***/
#endif

I don't think that version() and debug() need to be tangled up with all kinds of
boolean expressions, but maybe a short-and-sweet concession to allow an
equivalent to #ifndef is in order?  Sure its just "one line more readable" but
it *is* more readable after all. 

- EricAnderton at yahoo



More information about the Digitalmars-d mailing list