in reply to Re: Perlish Debugging Style
in thread Perlish Debugging Style

BrowserUk had a similar comment, so please consider this a response to both your remarks.

Smart::Comments is cool -- I hadn't seen that before. It does satisfy a similar itch, but not the *same* itch. My interest is not in having debugging code that only runs while I'm in debugging mode (though there are times when I want that, and Smart::Comments will scratch that itch nicely).

Instead, my interest is solely in being able to add temporary code which will be physically removed from the source -- whether programatically or not -- before it is released to anyone. It's a stylistic question, and that's all. Many people marks such temporary lines of code by outdenting, surrounding them with special comments, using DEBUG: { } style labeled blocks, etc. Whatever works, you should use. The purpose of the Meditation is a style of highlighting this type of code visually that I've found interesting, with the hope that others who think in a similar way will benefit.

So, when you say "It's really confusing to have leading semi-colons because I'm so used to that having meaning in other languages.", my only real response is: this meditation is not for you then, use whatever works for you. In fact, I was sort of hoping that other people would share their preferred style for such things.

Just to be painfully clear, since I get the feeling people are reading more into this meditation than intended: this is not a suggestion for a standard, an assumption that this is better than any other method, etc., nor am I suggesting that these lines be left in any code that is shared with other people.

I hope that clears things up a bit. ;-) But thank you for pointing me at Smart::Comments, as that will be useful to me for conditional debugging code I *do* want left in.

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Replies are listed 'Best First'.
Re^3: Perlish Debugging Style
by diotalevi (Canon) on Mar 02, 2006 at 17:33 UTC

    Well... then pass your source through a s/^\s*#{3,}.+/mg filter. You get Smart::Comments *and* you get your redacted distribution. I'd just as soon leave the Smart Comments in there though. You can get better bug reports that way.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊