Saturday, June 09, 2007

How to not search

While reading Mindware this evening I went to get the bottle of cider for a refill. And in turning to look for it I solved half the "problem" of reaching for it.

Andy Clark makes a persuasive case for the lack of an homunculus in elaborating on the lower level connectedness of perception and action. He argues that we do not necessarily perceive, think, act; but that the action is already part of the perception - the looking at the cider bottle is already part of / makes easier the reaching for it. Hence there is already less need for the "think" in "perceive, think, act".

There is less need to conceive of "a bottle" and "how to reach for it", because looking at it has already solved a lot of that problem, and "reach for it" becomes more of a stock action - always reach forward in the direction you are looking.

So it is also with programming:

We offer our customers support via a web site and email. It is all built on the great roundup system. One of the problems we dealt with a while back was handling "Out Of Office" replies - log them and ignore them.

Lately we've installed a new email system which handles such emails differently - it does not change the subject of the email, just the message. And, naturally, the earlier solution was based just on recognising subject lines. So, I add in a few lines to try recognising such emails by their messages too. Didn't work - my inbox is still full of the things. So I need to delve deeper, specifically I want to find out why roundup is sending me these emails, so
  • cd /usr/lib/python2.4/site-packages/roundup
  • find . -name "*mail*py" -exec grep smtp {} \; -print
And there I was reaching for the cider bottle again, by looking for it. I may not have decided yet what code to write to stop those emails being sent, but when I do decide that, I won't need to decide where.

Of course, looking for the right place in the code is rarely as simple as "cd, find, grep", but as we read through reams of code, trying to understand it, we are not seeking a general understanding of the code. Rather we are specifically sieving out the data structures and algorithms irrelevant to the problem. By the time we get to where the solution wants to be, it is no wonder we have already collected the very tools needed for the fix.

One of the reasons I was looking at copycat was that I appreciated it's "biological plausibilty". And one of the biggest caveats I had about it was the huge disconnect between its Slipnet's "perception" of concepts in a string and the "action" of its codelets on the string. It tends to follow the "perceive, think, act" cycle which is downplayed by what I was reading from Clark.

Slightly related:
How to find the most pythonic implementation of the singleton pattern? Search for not singleton !

Labels: , , , , , , , , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home