Stuck in an Infinite Loop,
by Prof. J. D. Dougherty (Haverford College Computer Science), spring 2004
Tune: "Stuck in the Middle with You", by Joe Egan & Gerry Rafferty.

Recording: mp3
(Guitar and vocals: J. D. Dougherty, Recording engineer: Walter Smith)

OK, this may not really be a physics song, but most of us have to program computers, and have run into this problem. (Plus, it's just a great song!)

 1. Well, I don't know how I got in this state. Hey, it seems that I'm a victim of fate, The loop that I wrote just doesn't work, Now I'm feeling like an infinite jerk. Dave to the left of me -- J.D. to the right, Here I am, stuck in an infinite loop. Here I am, stuck in an infinite loop. 2. And I don't know what it is I should do, The debugger tells me I'm really screwed. Dave to the left of me -- J.D. to the right, Here I am, stuck in an infinite loop. 3. (bridge) Well I started with a precondition And really thought I had a plan. The monitor comes over, "Force-quits" the machine and says, "SIGABORT -- segmentation fault." 4. Tried to make some sense of my code, But it seems I let the logic explode. I thought I could just experiment, Next time I'll use an invariant. Dave to the left of me -- J.D. to the right, Here I am, stuck in an infinite loop. 5. (bridge) Well I started with a postcondition And really thought I had a plan. The monitor comes over, Unplugs the machine and says, "Now it halts -- not my fault. 6. Well, I don't know how I got here tonite. The progress condition just wasn't right, My poor brain is under way too much stress, Perhaps recursion would have been best. Dave to the left of me -- J.D. to the right, Here I am, stuck in an infinite loop. Here I am, stuck in an infinite loop. Here I am, stuck in an infinite loop. Here I am, stuck in an infinite loop ....................

Image courtesy of Infinite Loop Software