[Catalyst] The 2nd law of debugging (was: Weird error using Catalyst::View::Mason)

A. Pagaltzis pagaltzis at gmx.de
Tue Feb 7 13:51:59 CET 2006


* Raphael Kraus <rkraus at wildtechnology.net> [2006-02-07 10:15]:
>D'oh... Why is it that problems always bug me, and I don't get
>it until I ask on a mailing list - and then I see my own
>mistake...

Because when you stare at a problem for a long time you get into
a mental rut and become blind to your assumptions; by explaining
problem to someone else you can often break out of the rut and
realise your assumptions.

    Another effective [debugging] technique is to explain your
    code to someone else. This will often cause you to explain
    the bug to yourself. Sometimes it takes no more than a few
    sentences, followed by an embarrassed "Never mind. I see
    what's wrong. Sorry to bother you." This works remarkbly
    well; you can even use non-programmers as listeners. One
    university computer center kept a teddy bear near the help
    desk. Students with mysterious bugs were required to explain
    them to the bear before they could speak to a human
    counselor.

    —Brian W Kernighan, Rob Pike, “The Practice of Programming”

Reportedly, this worked well and markably reduced the load on the
understaffed computer centre.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list