python vs d

Chris via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 08:59:45 PDT 2014


On Wednesday, 30 April 2014 at 14:57:44 UTC, Ola Fosheim Grøstad 
wrote:
> On Wednesday, 30 April 2014 at 10:56:22 UTC, Chris wrote:
>> which is not very elegant, and it's error prone (what if you 
>> overlook the TEST && bit for release?)
>
> I'd probably tie it to DEBUG and make sure it has the correct 
> value whenever DEBUG is false. No need to remove it before 
> release.
>
> Ola.

I think it is not feasible to tie everything to DEBUG. Debug is a 
signpost that marks well-defined "problem zones". Often I need 
just a little writefln() statement somewhere in the code to see 
what is going on / wrong in a certain block. The simplest example 
is to insert writeln() simply to see up to which point it prints 
before the app crashes. Believe it or not, I find this technique 
very efficient in certain situations.
Python often gets in my way when micro-debugging in this way, 
because of indentation terror.


More information about the Digitalmars-d mailing list