I just spent the last eight hours in a jQuery training class. I noticed that in some sections I was pretty bored, but in others I was completely engaged.

After a while, I realized I could easily predict whether a section would be interesting or boring with the following heuristic: slides suck, code rocks.

I think we need to get away from the idea that a bunch of code snippets on slides is a good way to teach programmers. Think about this: if you needed to pick up a new language over the next week, how would you do it? When programmers want to learn a new language, there's really only one way we can really make progress: we play with it. We load up just a little bit of code, and we poke at it. A question pops into our heads and we find the answer with code. When we've got the basics, we start trying to build bigger things.

If this is the way programmers learn (and I claim that it is), why are we teaching them with snippets on a slide?

My favorite speaker of the day was BenAlman. Ben's talks were fantastic for two reasons: first, he was ridiculously knowledgeable about his subject matter. But almost as importantly, he spent a ton of time writing code for us. Everything he talked about was demonstrated on the fly with code running in the browser. Someone asked a question? Ben wrote some code to show him the answer.

After Ben spent five minutes refactoring two functions, I realized I'd learned more in those five minutes than I had in the hour leading up to it. An hour spent reading examples off slides.

I'm starting to think that this should be the go-to move when teaching programmers. Write code in front of us, live. You're allow to screw up; in fact, I hope you do! I'll learn something watching you fix it. This is how you'd teach a friend who'd come by your desk for help. Let's just pretend we're already buddies, and show me some code.