Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Debug code out of production systems

by BrowserUk (Pope)
on Jan 25, 2004 at 01:40 UTC ( #323904=note: print w/ replies, xml ) Need Help??


in reply to Debug code out of production systems

I think that this is probably the most 'legitimate' use of a source filter I've seen. I really like that it turns the usual practice on it's head and only imposes additional overhead (minimal, compile-time) when enabled, whilst imposing none when disabled. Nice++

However, I am also a little dubious about the use of =begin as the trigger, and as the name of the module.

Whilst =begin DEBUGGING and =begin VERBOSE read quite nicely, and combining that with the requirement that the second word be all-uppercase makes it less likely that it will step on anyones toes, using what is a fairly common place word 'begin' as the trigger seems to invite the possibility that it will encounter a few modules containing a

=begin HERE Some dramaticly dangerously piece of (DON'T USE) example code:) =cut

It's a stretch, but using a less common, combined or made-up word might lessen the chances. The only (pathetic, cutesy) possibiliy that comes to mind is

=dBugin DEBUG

Aweful, but it demonstrates the idea that a made up word that lends itself to immediate association with debugging, is less likely to turn up by accident, and less likely to be overlooked by the unfamiliar.

I also think that as a module name, 'begin' is most unlikely to attract my attention, or turn up on my keyword searches of CPAN for a debugguging aid.

I really do like the implementation though -- and I will be making use of it.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Timing (and a little luck) are everything!


Comment on Re: Debug code out of production systems
Select or Download Code
Re: Re: Debug code out of production systems
by liz (Monsignor) on Jan 25, 2004 at 10:02 UTC
    ...it will encounter a few modules containing a
    =begin HERE Some dramaticly dangerously piece of (DON'T USE) example code:) =cut

    For code to be included this way, it would have to be:

    • code, not some type of documentation. If it was some type of documentation, it would cause compilation errors.
    • the HERE or "all" feature must ba activated.
    I think that's a save stretch (famous last words ;-).

    I also think that as a module name, 'begin' is most unlikely to attract my attention, or turn up on my keyword searches of CPAN...

    Would "ifdef" have worked?

    Liz

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://323904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-12-29 07:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (185 votes), past polls