Either the faster students get bored during the lecture, or the slower students get lost. During the exercises, the same thing happens. Hands-On Perl provides an interesting solution to these problems. Instead of alternating lectures and labs, the lecture runs continuously. Each slide has an example on it.
Students try out the example while the lecture is going on.
The lecturer suggests changes to the example, and the students try out the changes and see the effects immediately. Some slides have exercises. Students work the exercises while the lecture is going on. Occasionally the instructor will pause to let the class finish trying an example. Students find it much easier to pay attention and learn the material when they are involved in what's going on instead of passively absorbing a lecture.