Stupid answering machine program code

« previous post | next post »

Perhaps it is because I'm at the Computability in Europe 2012 conference, a big meeting honoring the centenary of Alan Turing's birth, that I was reflecting on algorithms today. My phone answering machine at home is programmed to count the number of messages waiting to be listened to, storing the total in a variable I will call N, and then set another variable that I will call M to the initial value of 1; and the playback button causes the running of a routine of which the pseudo-code would be this:

if N = 1
   speak "You have one new message."
else
   speak "You have N new messages."
end if
for each M from 1 to N
   speak "Message M:"
   play message M
end for
speak "End of messages."
speak "To delete all messages, press Delete."

Can you see what's so incredibly annoying here, to a linguist, or anyone with some basic common sense about pragmatics?

The annoying bit is when (as happens so often for me, since I get few phone calls at home) there's only one message. What you get is:

You have one new message.
Message one:

No!!! If there's just one message you don't need to say it's message 1! You only need to say which message is coming up next if there's more than one! You need a "if N > 1" condition in there!

For heaven's sake, I'm not even a programmer. Is it so hard to get the code written by someone who has at least as much common sense (and desire not to have his time wasted) as me? You don't have to be a towering genius like Alan Turing to do better than this stupidness.

[Thanks for those who helped me remove the bug in the pseudo-code. There are zero comments to read. Comment zero:]



Comments are closed.