Debug arguments?

Ary Borenszweig via Digitalmars-d digitalmars-d at puremagic.com
Tue May 13 10:44:06 PDT 2014


On 5/13/14, 2:35 PM, bearophile wrote:
> 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

IMHO the compiler should be able to remove the unused arguments for you.


More information about the Digitalmars-d mailing list