Paul Makepeace ;-)

August 25, 2005

Dyslexic experience

Posted in: Drivel

I've just been working on a code bug that's taken probably 30 minutes to resolve. I finally tracked it down but even when I used tools to help me pinpoint it it still wasn't obvious. I've been programming on and off for twenty years and have, naturally, developed the ability to pick out these kinds of things at 30yds. I've generally found the notion that you can look at two things and not see the difference or not be able to instantly see that "independant" is spelt wrong as particularly odd. So I guess this experience was an insight into that condition. Yikes.

See if you can spot the bug! The issue is that headlines are being repeated.

[% MACRO show_newspoints(nps, co, show_little) BLOCK %]
<ul>
[% count = 0; FOREACH np = nps %]
 [% IF np.headline != last_headine %]
<li>[% format_date(np.date) %] - [% np.publication %]: <strong>[% np.headline %]</strong>
 [% END %]
 [% IF np.synopsis %]
 <br />
  [%+ np.synopsis %]
 [% END %]
 [% IF cgi.param('debug') %]
Importance: [% np.importance %]</br />
Sentiment: [% np.sentiment %]<br/>
Subject: [% np.subject %]<br/>
Subject UID: [% np.subject_uid %]<br/>
 [%+ END %]
</li>
 [%+ count = count + 1 %]
 [% last_headline = np.headline %]
[%+ END %]
[% IF count == 0 AND show_little %]
<li>There was little coverage for [% co.name %] in the sources
reviewed in this period.</li>
[% END %]
</ul>
[% END %]

Posted by Paul Makepeace at August 25, 2005 16:04 | TrackBack
Comments

headine?

Posted by: Nik at August 26, 2005 10:56

line 4?

Posted by: Nik at August 26, 2005 10:58

Nik: Yep

Posted by: Paul Makepeace at August 26, 2005 14:01

I know how you feel: I was recently looking at two 20 line blocks of code, and when I did a search and replace it reported 41 changes on 41 lines. It took me about 5 minutes to work out where the extra line was. Just feel very, very glad that this was an occasion rare enough to be noticeable.

Posted by: Nik at August 26, 2005 18:29
Post a comment









Remember personal info?