A kind of worked examples for large classrooms

March 21, 2014 at 1:51 am 14 comments

I passed on to the MediaComp-Teach list something I’m trying to do in my class this semester.  I had several suggestions to share it with others. It’s based on worked examples and peer instruction.

I’m teaching Python MediaComp, first time in 8 years on campus.  We have just shy of 300 students, and I have 155 in my lecture.  While I’m a big fan of worked examples, the way I’ve used them in small classes of 30-40 won’t work with 155.

Here’s what I’m doing this semester.  Every Thursday, I distribute a PDF with a bunch of code in sets, like this:


The students are getting 12-20 little programs every Thursday.  Most students type them ALL in before lecture Friday morning at 10 am.

Then on Friday, I put up PI-like questions like this:





Students are required to work on these in groups.  I walk around the lecture hall and insist that nobody sit alone.  I get lots of questions in the five minutes when everybody’s working away.

We don’t have clickers, but I’ve given every student four colored index cards.  When I call for votes, everybody holds up the right colored card.

Here’s the interesting part — they TALK about the programs.  Here’s a question in Piazza with a student’s answer:



The other instructor in the class is also using these, and he says that the students are using them after the Friday lecture as examples to study from and to use in building homework.  I’ve had lots of comments about these from students, in office hours and via email.  They find them valuable to study.

My worked examples aren’t giving them much process.  I am getting them to look at lots of programs, type them in, get them running, and think about them.  I’m pretty excited about it.  Given that I haven’t been in this class in the last 8 years, the class isn’t really “mine” anymore.  I’m trying to be sensitive to how much I change about a huge machine (14 TA’s, two instructors…) that I’m only visiting in.  But everyone seems into this, and it’s fitting in pretty easily.

I have been uploading all of the PDF’s, PPTs, and PY’s  at http://home.cc.gatech.edu/mediaComp/95, if you’re interested.  (There are some weeks missing because Atlanta actually had some Winter this year.)


Entry filed under: Uncategorized. Tags: , , .

Who Needs to Know How to Code? More than just the rich white boys ScratchJr: Coding for Young Kids — Kickstarter Campaign

14 Comments Add your own

  • 1. Michael Lee  |  March 21, 2014 at 5:00 am

    This is great and what you are doing is clearly engaging the students! I am especially struck by one of your last comments: “I am getting them to look at lots of programs, type them in, get them running, and think about them.”

    Inspecting and thinking about the programs as the students type them in and afterwards gives them several opportunities to reflect on the code and possibly mentally execute it in their heads. I wonder how students might react to faulty code examples, where the code is nearly correct, but they *know* that part of it is incorrect/buggy and have to fix it?

    The work I have done in an online programming game setting suggests novices may benefit from this type of exercise, but it is unclear how it may work in a classroom setting at such a large scale!

    • 2. Mark Guzdial  |  March 22, 2014 at 9:15 am

      We’re thinking about something like that near the end of the semester. When I did STABLE with Colleen Kehoe many years ago, we found that novices avoided the buggy worked examples. When they’re still trying to figure out how to make things work, they only want to look at positive examples. It takes some expertise to be able to find and fix buggy examples.

  • 3. Carl Alphonce  |  March 21, 2014 at 8:18 am

    Mark – this sounds really interesting. I’ve been participating in an on-line group discussing how to increase student engagement in the classroom. I’ve been using clickers and have struggled with how to ask good questions about code since there is such limited real-estate on a slide. Distributing the code and having them do worked examples ahead of time could solve this problem.

    I clicked on the link for the materials, but I get “Access Denied”. It looks like a username/password is required.

  • 4. CSProfMom  |  March 21, 2014 at 8:29 am

    I’ve been doing a lot of this type of in class exercise in my introductory programming courses over the last couple of years. The students sometimes work on them alone, but sometimes I have them initially vote on their own, and then form groups, discuss, and revote. The students seem to do pretty well on these exercises, but when it comes time to apply this knowledge by writing programs, they are as lost as ever. It seems like the ability they have to read and understand a program does not translate to the ability to create a program. Have you encountered this? Do you do something else to help the students transfer “code reading” skills to “code writing skills”?

    • 5. Mark Guzdial  |  March 21, 2014 at 8:39 pm

      See Ray Lister – this is a focus of his work.

      • 6. Raymond Lister  |  March 22, 2014 at 10:27 pm

        Naturally, it’s difficult to say much without knowing more about your students. All I can do is speculate. When students “read” code to figure out what the code does, they don’t necessarily “read” the way we’d like them to read. For example, some students figure out what a piece of code does by plugging in some initial values, tracing the code (perhaps more than once), then making an inductive guess based on the code’s input/output behaviour. If a student gets the right answer that way, I wouldn’t expect them to be able to write code. I can only suggest that you find some willing student volunteers, who seem to get the right answer to the reading questions and who cannot write code, and then sit down with them one-on-one and have them solve a few problems while “thinking out loud”. (And maybe you should write a paper about what you find out, so we all benefit.)

    • 7. Peter Donaldson  |  March 22, 2014 at 11:11 am

      You might also want to check out the work that’s being done in Israel recently on Pattern Orientated Instruction which attempts to make it easier for novices to write programs of their own.

      On the subject of program comprehension you might also want to look at a paper by Carsten Schulte et al. An introduction to program comprehension for computer science educators.

  • 8. Valerie Summet  |  March 21, 2014 at 10:53 am

    I really like this idea as well. A few logistics questions… I assume this is a MWF class and all of Fri. is dedicated to group problem solving? Are MW dedicated to covering the topic in other ways?

    • 9. Mark Guzdial  |  March 21, 2014 at 8:38 pm

      Yes. I try to use PI and predictions and other kinds of small group activities.

  • 10. Greg Wilson  |  March 22, 2014 at 12:38 pm

    Like Carl, I’m getting “Access Denied” when I try to view the PDFs.

    • 11. Mark Guzdial  |  March 22, 2014 at 6:41 pm

      Please email me for the passphrase.

  • 12. Krishnendu Roy  |  March 24, 2014 at 1:49 pm

    You might want to look at Socrative (http://socrative.com/) as a free alternative to clicker.

  • […] to expand our techniques repertoire beyond simply grinding at code. We could try techniques like worked examples, Problets, CodingBat, games with learning outcomes like Wu’s Castle, multiple choice questions […]

  • […] rather than use the colored index cards that I’ve used in the past for Peer Instruction (see blog post here). With cards, I can only take a vote — no histogram of results, and I can’t provide any […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Trackback this post  |  Subscribe to the comments via RSS Feed

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 10,184 other subscribers


Recent Posts

Blog Stats

  • 2,054,191 hits
March 2014

CS Teaching Tips

%d bloggers like this: