TeachScheme!

Teaching beginning programming and algebra
with Scheme

Introduction

Dr. Stephen Bloch, Adelphi University

What is this workshop about?

This workshop grew out of work done at Houston's Rice University on teaching beginning computer programming. Rice faculty worked out an approach that worked well for their freshmen, then adapted it for use at the high school level and started offering summer workshops for high school math and computer science teachers. Over the past seven years, these techniques have indeed been implemented successfully in many high school computer science courses; but just as importantly, they've been put to use at both high and middle school levels in teaching algebra.

What does computer programming have to do with teaching pre-college math?

In brief, each hand washes the other. On one hand, the best predictor of student success in college computer science courses is success in high school algebra. The two fields share a lot of the same concepts: variables, operators, nested expressions, functions, domains, ranges, function composition, Cartesian products, etc. On the other hand, computers provide a more concrete (and more fun) way to illustrate these mathematical concepts than the blackboard. Students can all too easily tell themselves that things like variables and functions are "unreal", the product of their instructor's fevered imagination. But it's harder to dismiss variables and functions as "unreal" when you watch them working right in front of you.

The TeachScheme! curriculum strongly emphasizes "design recipes", sequences of specific steps that students can follow to get from a problem statement in English to a working program. The same design recipes, with minor modifications, can also help students translate a word problem into algebraic form. Furthermore, the DrRacket platform provides a wonderful laboratory with which to experiment with mathematical concepts and teach many of the New York Regents "key ideas" for K-12 mathematics.

One day in September, I was talking to a late-added student after class, trying to catch her up with her classmates. I wrote the expression "3 + 4 * 5" on the board and asked what its value was. She confidently answered "35", so we talked about order of operations and how to evaluate complex algebraic expressions, illustrating the difference between (3+4) * 5 and 3 + (4*5) with Scheme expressions that she could watch the computer evaluate, one step at a time. I watched light bulbs go on over her head as she exclaimed "I could use Scheme to help with my math homework!" She had a lot of catching up to do, but she earned a B (which, in my classroom, actually means above average) for the semester.

The Program by Design Project (formerly known as TeachScheme!, but that gave people the misleading impression it was about the Scheme language) comprises several components:

  1. a simple, consistent computer language, currently a small pedagogically-oriented dialect of Scheme;
  2. a beginner-friendly development environment, DrRacket, which is freely available for Windows, Macintosh, and Unix;
  3. a pedagogical approach based on "design recipes" that help students approach problem-solving in a methodical, rather than random, way; and
  4. a variety of textbooks and course materials, most of which are also freely available on the Web. The original textbook was How to Design Programs; there's also a not-yet-finished second edition of How to Design Programs, and a more recent textbook Picturing Programs aimed at high school and non-major-college courses, and the Bootstrap Project aimed at middle school students, and a follow-up textbook How to Design Classes covering the transition to Java.

The conceptual core of the project is the design recipes: they can in principle be taught without the text, or without the DrRacket platform, or even without Scheme. For example, I translated many of the design recipes to Java for a freshman class five years ago. But the four components support one another: in particular, it's much easier to teach principled, methodical design recipes with a language that doesn't get in the way.

Why Scheme?

What are students supposed to learn in a first programming class? Which of the things they're supposed to learn are important and fundamental concepts, and which are merely necessary skills, to be obsolete in a few years? I start with the assumption that

From this perspective, any computer language is a necessary evil: necessary in order to write real programs that really run on real computers, but evil insofar as it distracts students from thinking about problem-solving. In 1998-99, when I taught beginning programming in Java, I felt that every time I wanted to introduce a new programming principle, I had to waste a day or more of precious class time on semicolons, curly-braces, menu selections, and dialogue boxes before the students could put the principle into practice. The programming language was getting in the way of what I wanted to teach! So I add two corollaries:

Scheme is a full-fledged programming language, every bit as powerful as C++ or Java, but with a much simpler syntax, so you can spend your time on fundamental concepts rather than memorizing syntax rules. In my first-semester programming course, I teach perhaps half a dozen syntax rules, one at a time. That's fewer than it would take to write the simplest "hello, world!" program in C++, C, or Java, yet by the end of the semester my students are writing recursive functions, traversing linked lists, binary and n-ary trees, and writing functions that operate on other functions as parameters.

Furthermore, the DrRacket software package is designed for educational use: it provides a minimum of options and menus, a "stepper" feature with which students can observe the evaluation of an expression step by step, and a series of instructor-customizable "language levels" that tailor the language to the student's experience level (so a student who accidentally invokes an advanced feature of the language gets an appropriate error message rather than inexplicable behavior).

But don't take my word for it. Read what other high- and middle-school teachers have said about the approach.


This material is based upon work supported by the National Science Foundation under Grant No. 0010064. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.


Last modified: 
Stephen Bloch / sbloch@adelphi.edu