Debug arguments?

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Tue May 13 10:35:50 PDT 2014


Gary Willoughby:

> Without trying to sound condescending, if you need to pass 
> certain arguments only in debug builds something has gone 
> terribly wrong with the design of your program. IMHO good OOP 
> design would remove the need.

I think often OOP obfuscates the actual flow of data between 
functions (methods). So I even suggested to give D a kind of its 
opposite: https://d.puremagic.com/issues/show_bug.cgi?id=5007

In the debug build inside some functions I print some of the 
current state, as modified by a function. The extra arguments for 
the debug build are needed to produce a better or more complete 
print. But in release builds I'd like to avoid passing extra 
arguments that are useless.

Bye,
bearophile


More information about the Digitalmars-d mailing list