In the Classroom


My ten rules for teaching are too high-level to be immediately useful in the classroom, so here are ten others that I hope will help people in the moment as they deliver lessons on programming:

  1. Have the learners do something interactive every 5-15 minutes. We always have too much material, and it’s always tempting for us to teach at the speed at which we can talk rather than the speed at which people can learn. Answering a multiple choice question, writing three lines of code, or predicting what the code on the screen will do when it’s run only takes a minute or two, but gives us and our learners feedback on whether they have actually understood the most recent part of the lesson. Doing this also keeps learners’ attention focused on the lesson.

  2. Get the learners out of their seats every 45-60 minutes. Brains get tired, and tired brains can’t learn. Caffeine doesn’t cure this, so get your learners up out of their seats for a short break every 45-60 minutes. This will allow those who need a bathroom break to take care of things discreetly, and give people with backs like mine a chance to stretch out the kinks. It also gives the instructor a few moments to answer questions, think about their backlog, and figure out what to teach next.

  3. Build things in front of them (and have them build along). Writing code while you’re teaching slows you down so that you can only go twice as fast as your learners rather than ten times as fast. It also helps your learners connect what you’re explaining with specific parts of your code, and allows you to make small changes or conduct small experiments in response to their questions. Finally, live coding allows your learners to see how you actually use your tool of choice.

  4. Make mistakes and work through them. Professional developers spend 25-60% of their time debugging; novices can spend 80-95% of their time trying to figure out what’s broken and how to fix it, but we rarely devote proportional time to error analysis and correction in our lessons. Watching you figure out that something is wrong, hearing you work backward through the error messages to possible causes, and seeing you make and test fixes is often the most valuable thing your learners will get out of your lessons, so do lots of it.

  5. If you use slides, fill them with graphics rather than text. Our brains have separate channels for processing visual and linguistic information, and people learn best when complementary material is presented simultaneously through these channels. In simple terms, that means your slides should present diagrams or other relevant images for you to talk about, rather than slabs of text or pictures of kittens. A lesson is a user interface for knowledge: everything you know about designing an intuitive interface applies directly to design of teaching materials.

  6. Use a visibly fair mechanism to distribute your attention evenly. Teachers naturally focus their attention on learners who are making eye contact and asking lots of questions—in other words, on the extroverts in the room. This creates two feedback loops: the extroverts ask even more questions because they’re getting attention, while other students stop trying to engage because they’re not. My favorite way to level the playing field is to have everyone put their name on a yellow sticky note and stick it onto their laptop. Whenever I interact with them, they take it down so that I can see who I have and haven’t spoken to recently. Doing this doesn’t just ensure that everyone gets equal air time: it also shows them that I’m trying to manage the classroom fairly, which helps build trust.

  7. Create a backlog. You want learners to ask questions, but you don’t have time to answer all of them, or might not actually know the answers. One way to handle this is to write learners’ questions on sticky notes and post them on the wall behind you. During breaks, you can look over this backlog and decide which questions you want to tackle. This gives you a chance to prioritize based on what’s most relevant (and what you actually know). It also helps build trust: many people have learned that “I’ll address that later” means “I hope you forget that you asked”, so if they see you trying to tackle a few of the questions that have come up, they’ll forgive you for not getting to the rest.

  8. Have learners work with each other. A sense of community is one of the primary motivators for adult learning, so encourage your learners to talk to teach as they work through exercises. Pairing them up will also level out differences in ability: on average, pairs will be more similar to one another than individuals are and will therefore move at a more uniform pace. If you pair people up, though, be sure to pair everyone and not just those you think are struggling: being singled out for remedial attention can be embarrassing and demotivating.

  9. Go back right away to the person who didn’t know the answer. If the first person you ask doesn’t know the answer to a question, but the second person does, immediately go back to the first person and have them re-explain what the second person just said. This helps ensure that the first person actually understands, and also makes it less likely that people will just shrug and say, “I dunno,” when they’re asked to think. If they know they’re going to have to explain it anyway, they’re more likely to try the first time.

  10. Bring a toothbrush, a clean shirt, cough drops, and comfortable shoes. If you are teaching an evening class after working for a full day, you and your learners will both appreciate it if you brush your teeth and put on a clean shirt. Cough drops will help you keep your voice (and help fend off whatever colds the learners brought with them), and your back will be grateful tomorrow that you wore comfortable shoes today.

These are my top ten practical tips for teaching programming. I’d enjoy hearing about yours—I’ve had to disable comments on this blog, but if you email me, I’d be happy to add them and give you credit.