Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Do you have a coding mantra? Some phrase or saying (or question) that you repeat to yourself while coding?

In a recent rare moment of self-awareness while coding, I noticed a little voice repeating "How am I going to debug this? How am I going to debug this?" while my fingers were typing

... my $html = $template->expand(\%bindings); return $html; }
I stopped and looked at what I'd typed, and considered for a moment why I hadn't typed
return $template->expand(\%bindings); }
or just
$template->expand(\%bindings); }
The reason goes way, way back to having looked over the shoulder of a really good programmer early in my career. I asked him why he was seemingly wasting a short-lived variable, and he answered that he was always on the lookout for places where he would later need to place breakpoints to examine intermediate results while debugging, and that sometimes he had to make opportunities. He went on to explain that debugging time was part of overall productivity (duh, once you've gotten that point), and that planning for debugging kept debugging time down. It seemed like a really good explanation, and from then on I would mutter "How am I going to debug this?" to myself. Over time, that voice faded into the background, but it's still there, chanting away. The funny thing is that I rarely have to use breakpoints when debugging, even though I automatically make opportunities for them.

What is your programming mantra?


In reply to Programming Mantras by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2024-04-23 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found