Doug's musings
<< Pictures from Europe 2002 > November Stupid White Men >>

Tuesday, 26 November 2002

Incorrect assumptions ::

I was thinking about how someone had taken a function I’d written and mistakenly applied its assumptions to a completely different case. Why didn’t he know better? Because trusting me appeared to be an opportunity to save time by not having to learn more about the differences between the situations.

A few minutes later I was thinking how I’d gotten two emails with the same theme in the last 24 hours: two different pieces of quick-and-dirty test code I’d written didn’t handle errors well. Those mistakes remained in place when the test code had mutated into sample code. The improper, or lack of, error-handling caused problems. I thought, funny, that’s two instances of the same problem in a day, I bet there’s a third.

It didn’t happen today, but there was that first situation. Not a big coincidence, but definitely a “pay attention.”

Lessons: when writing code, document assumptions (e.g. “this entire program is a quick and dirty hack!” Or, “this is only how foo looks when encoded in the bar format.”). When reusing someone else’s code, especially if it doesn’t look thoroughly documented, question its correctness and applicability.

Tue, 26 Nov 2002, 17:50 EST
[ Musings ]
<< Pictures from Europe 2002 > November Stupid White Men >>