On Fri, Aug 18, 2006 at 11:58:20AM -1000, Joshua Hoblitt wrote:
: It occurred to me that other day that in our "in house" C code we
: somewhat frequently use an idiom that's not easily translated into Perl
: 5.  Our rule is that if your commenting out more then 1 or 2 lines of
: code that you wrap it in a CPP if statement.  The logic being that
: if you haven't deleted the code then it must have some reason of hanging
: around (and you may actually want to use it again someday).  This is most
: often the case with specialized debugging code. E.g.
: 
:     #if 0
:     ...
:     #endif

    if 0 {
    ...
    }

: The great thing about this is that the you only have to flip the 0 to 1
: to re-enable the code. E.g.
: 
:     #if 1
:     (magic now happens)...
:     #endif

    if 1 {
    (magic now happens)...
    }

Larry

Reply via email to