 American actor Kelsey Grammer was brought in to guest star as Sideshow Bob for the third time . At that time , Grammer had become a household name as the lead of the television series Frasier , which was in production at the same time as this episode . Grammer did not know that the rake scene was extended , because he had only done the moan once and was surprised when he saw the final product . The show 's writers admire Grammer 's singing voice , and try to include a song for each appearance including this episode . Alf Clausen , the primary composer for The Simpsons , commented that " [ Grammer ] is so great . He 's just amazing . You can tell he has this love of musical theater and he has the vocal instrument to go with it , so I know whatever I write is going to be sung the way I 've heard it . " 
