Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Many of us have blind spots when it comes to reviewing or debugging our own code. We readily see problems in others' code that we're blind to in our own. We know what we just wrote, but our brains can't let go of our intent long enough for our eyes to really see what our fingers just typed. Peer review is the standard way around this, but often we're working alone, without ready access to qualified reviewers, and need to go it alone. Somehow, we need get our minds into a place where we can get past our blind spots.

Several years ago I picked up a way to trick my ego into getting out of the way. I offer it here in the hope that it'll resonate, or at least get others thinking.

My trick is to imagine that I had a fever when I wrote the code I'm now looking at, and that someone else had looked at it and pointed out that there were problems, but hadn't explain what they were.
This has a couple of effects. First, it gets my brain out of "there's no problem here" mode and into search-and-destroy mode. I really, really don't like having others find bugs in my code. (It's that damn perfectionist upbringing.) And to have somebody spot a bug and then not tell me... that gets me fired up even more.

By imagining that I'd had a fever, I sidestep overconfidence, and open my mind to the possibility that I was actually fallible at the time my hands were busily typing. I also pre-excuse myself for any problems that I find. (When I run a fever, my mind can play some mean tricks. I've learned to triple-check anything I try to do while sick.)

Thus tricked, my ego stays out of the way long enough for me to find lurking problems. When I remember to use this technique, my code comes out a lot cleaner.

That's what works for me. What works for you? How do you get your ego our your way?


In reply to Tricking Our Egos 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 imbibing at the Monastery: (5)
As of 2024-03-29 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found