Teaching and learning with “gift code”

Last month I co-taught a two-and-a-half day workshop introducing students to building apps with MIT App Inventor. Some of our students had prior programming background, and others did not.

Here, our goal as teachers was to get our students engaged in their own original projects (rather than teaching any specific set of computing concepts).

I’ve done a bunch of workshops like this, with learners of all ages, and we’ve developed the concept of “gift code.” (Thanks, Michael Penta!)

With gift code, a student describes their idea to you, and you translate it back to them in the form of working code.

Ideally, gift code has the following properties:

  • It’s short. I’ll dictate the code and have the student type it in (or in the case of App Inventor, select and configure the code blocks). It really has to be small so neither of us gets impatient.
  • It works. The premise is that the student will understand the computational ideas in the code by seeing them work. Often the code will combine a bunch of concepts together—ideas that would be hard to explain individually, but make sense when combined into a working unit.
  • It’s the student’s idea. This is pretty important—the code should embody the student’s idea! But it’s OK to simplify what they said, as long as it demonstrates the essence of what they wanted.
  • It’s extensible. This is crucial. In a few minutes, I’m going to walk away and work with another student, and I want my student now to understand enough so that they can keep going. It’s fine if their next step is a copy-paste of the same code structure—e.g., adding a new condition-action rule.

It’s really fun when it works. Students are empowered because they can get complex things working quickly.

In the best case, an hour after receiving gift code, a student has full ownership over it. They understand it, they have added to it, and they don’t even remember that I gave it to them. (That’s totally fine with me.)

Do you use gift code in your own teaching?

Fred Martin
CSTA University Faculty Representative

2 thoughts on “Teaching and learning with “gift code”

  1. I get my ‘gift code’ from Stack Overflow. Usually from the archived answers, rather than real-time. I ask a question, usually via a google search, and the top few hits are most often Stack Overflow pages, where my question has been answered with a snippet of “gift code”. I use the code almost exactly as you describe – first just trying it to see if it works, and then understanding it as I play with it.

    I think in your classroom you’re providing the same service to students who are not yet sophisticated enough to ask their questions of the internet. It takes a good bit of vocabulary to get the internet to provide you with ‘gift code’.

    When I teach, I provide ‘gift code’ quite often, in the way you describe. I also try to move students toward getting their ‘gift code’ in other ways, since I want them to be able to get their questions answered without me in the room! But I have them much longer than 2.5 days.

  2. Fred,
    Yes! I love this!
    This happens a lot in the middle school after school robotics club. I just don’t have a lot of time to spend one-on-one with the students, and the last thing I want is another “you sit in your seats while I lecture you how to do this” experience for an after-school activity.
    They will build a robot using mindstorms, and then ask for help. I ask what they want it to do, and while I write the blocks, I demo in a very general way how mindstorms works.
    Once I get to witness the joy when the program runs and brings their robot to life for the first time, they will ALWAYS ask for some enhancement – and (by design) I’m already walking away, telling them to poke around and call me when they get it working so I can see it.
    It’s a super fun way to teach. “Gift Code.” Great phrase. More of this!
    Donna

Comments are closed.