Is Live Coding Worth It?
I put together an introductory lecture on regular expressions yesterday, but I’m not happy with the results, and I’d like your feedback to help me make it better.
One of the reasons we’re moving from static HTML to videos is to show people how to program, rather than just the results of programming. As part of that, I want (or wanted—I may be changing my mind) to do all the programming examples live instead of showing snippets of code and snippets of output slide-style. Jon has already done that with the database lectures, but his “programs” were single-line SQL statements; this episode is the first time we’ve had longer examples. It was a pain to do: each time I made a typo inside a function definition, for example, I’d wind up with a dozen or more junk lines on screen (since the error wouldn’t show up until the first time I called the function). I don’t want to waste viewers’ time on trivial errors, but there’s no way in IDLE (or other IDEs) to erase the last few lines of interaction with the interpreter. I “solved” the problem by hitting return until the offending text had scrolled off the top of the screen, but it leaves a couple of ugly breaks in the video. If IDLE had a “clear screen” button, I might use that periodically, but (a) it doesn’t, and (b) one of the reasons to code live is to keep recent context in view, which “clear screen” would erase.
There’s also an annoying IDLE-specific problem in this video: if I type too quickly—in particular, if I have saved program text in another window, switch there, copy it, and paste it into IDLE instead of typing it back in character by character—then syntax highlighting doesn’t work properly. You’ll see a few places where highlighting simply gave up partway through a keyword. It looks dumb. I could turn highlighting off, but I find it useful, and I think students do too. (Also, if it’s on by default, our videos should show it on.)
(And yes, I could switch to another IDE—I’m very fond of Wing 101—but we found that when Camtasia is in “record” mode, Wing’s debugger won’t launch. We think it’s because recording slows my machine down just enough for Wing to timeout when forking the subprocess responsible for managing the user’s program, but that’s just a theory for now.)
(And while we’re on the subject of Camtasia: its recorder on Windows has a very handy “pause” button, so I can pause recording, switch windows, copy text to be pasted, switch back, re-start recording, and not have to do a ton of slice-and-dice editing after the fact. The Mac version doesn’t have this feature yet, which is just as annoying as the fact that the two versions can’t read each other’s project files. It’s still a very useful tool, though—the editing interface on Windows is a snap.)
Next up: I’ve used slides for notes about the code, such as an explanation of what regular expressions are. (I didn’t tick the right box when exporting them from PowerPoint, so they’re 3/4 the size they should be in the video, but that’s a small problem compared to the ones I’m wrestling with now.) I think the transition from code to slide and back is awkward, but I don’t know how else to present material that in class I would draw on the whiteboard.
However, using slides at all raises a question: why don’t I just past my code snippets and their output into slides and show those? Do you, the viewer, really gain anything by watching me type? If so, why? Does the gain come from having a few lines of recent context above the example I’m typing in next? If so, that would be easy to replicate in a slide deck. I could even (easily) do double slides for each example, with the code on the first slide, and the code and output together on the second, so that you don’t have to read too much at once. I’m still convinced that live-in-the-IDE is the right way to show people how to use a debugger, but this experience has soured me a bit on doing it for code.
Your thoughts would be very welcome…

Can’t some of the grief be avoided by editing? I don’t think the virtue of coding live is to supply an absolutely faithful record of the session, but to give the student the experience of programming.
I’d feel free to edit (after the fact, yeah it’s expensive) out the tedious junk. Students need to see you make mistakes; it helps drive home the point that ordinary mortals can program. They don’t need a detailed record of the mistakes (unless the point is how to read error messages).
I worry a little about your intention to do “all programming examples live…,” perhaps a mix of dynamic (live) and static is what’s needed. After they’ve seen you create a couple of re’s the fourth or fifth may.
For shortish commentary that you currently have on slides, such as the bullet points explaining that ‘|’ means ‘or’, you could instead type each one into the shell as a comment. Perhaps the slide would still exist as a summary.
Could you display the current slide beside the screen capture window?
The transition to a slide was sometimes a bit too fast — I hadn’t quite finished looking at the stuff in the IDE.
On the slide about ugly notation, it would have been good to say “because” or something to explicitly express that these are two reasons why it’s ugly. The bullet points being indented on the slide indicates that these are sub-points, and from there the inference is really small, but I didn’t actually see the bullet points at first (maybe not a problem when you get the right point size) and it would be so easy to add a word to get that across orally.
I can appreciate the problems you mention on your blog, but still feel the overall result is quite good.
> Do you, the viewer, really gain anything by
> watching me type? If so, why?
I feel like it gave me time to absorb what you were doing, and it forced me to read the code in small pieces. If you decide to use slides to present code, I think it would be worthwhile to introduce the code in very small, logical pieces to avoid overwhelming your viewer.
I worry a little that people are accustomed to reading slides and may not be in the right mindset to absorb the material if it is presented in slide form. If you’re just conveying facts, then a slide presentation is fine, but I feel that part of what you are trying to teach is the process of programming, and I’d rather they experienced that instead of reading it.