Department of Computer Science
University of Northern Iowa
For over two years, a group of computer science (CS) educators has been exploring the role that patterns and pattern languages can play in helping students to learn how to design and implement programs. We have focused on so-called "elementary patterns", recurring solutions to problems students face at their own level of programming. At the 1998 OOPSLA Educators Symposium, I reported on the 1998 ChiliPloP hot topic workshop, also titled "Elementary Patterns and their Role in Instruction". In this report, I will describe some of the developments in elementary patterns since last year's symposium, including what transpired at the 1999 ChiliPLoP Hot Topic.
Helping novice students learn how to write computer programs is a difficult task. Students must learn, among other things, how to use a programming language; how to create readable, modifiable code; how to evaluate the quality of programs; and how to modify existing code. They must also learn how to decompose solutions into parts, to make design trade-offs based on conflicting goals, and to "grow" their programs as they come to a better understanding of the problem's requirements.
The software patterns movement addresses many of these difficulties directly and most others indirectly. Pattern languages describe structures that recur in the constructed world, structures that balance the various forces that drive designers to achieve conflicting goals. Pattern languages allow designers to guide the evolution of their products by the process of piecemeal growth . The literary form of patterns stresses the documentation not only of solutions but also reasons: explication of the forces and how the pattern resolves them. The form also encourages the author to document examples of the pattern and to build on the examples of other patterns in the language. Taken together, these features make patterns a potentially powerful vehicle for student learning.
Prior to the ChiliPLoP'99, a number of elementary patterns appeared at various conferences, in particular Roundabout , One Loop for Linear Structures , a rough language of loop patterns , and a pair of elementary OOP patterns, delegation and substitution . Nguyen  and Goodrich et al.  also reported the use of several patterns from Design Patterns  to teach data structures.
Robert Biddle, Rick Mercer, and I organized a workshop at OOPSLA'99 on the topic of evaluating object-oriented design. At that workshop, I presented a short experience paper on the use of a pattern language as a tool for evaluating design . I base my approach on the notion of diagnosis described by Christopher Alexander in The Oregon Experiment . Pattern languages provide not only a vocabulary for discussing designs but also relatively explicit descriptions of when to consider using a pattern and of what forces to take into account.
The second Hot Topic on elementary patterns and their role in instruction took place at ChiliPLoP'99. Four veterans of the first workshop--Joe Bergin, Robert Duvall, Rick Mercer, and I--were joined by newcomers Doug Dechow (Knox College) and Dwight Deugo (Carleton University). We chose this year to focus specifically on elementary patterns of object-oriented programs. To make our task more concrete, we decided to outline a small manual structured as a set of pattern languages, to serve as a companion volume to the typical CS1 textbook. Material for some of the chapters came largely from existing patterns work, such as the selection, loop, and recursion patterns. Some of the chapters present challenges to the elementary patterns community to write more patterns, especially in the areas of novice analysis and design.
Work on these and other areas continues. Available on-line are some rough notes on the workshop and rough working notes on the first two chapters of the proposed book.
The original ChiliPLoP'98 Hot Topic participants organized and led two workshops on elementary patterns at SIGCSE, the week after ChiliPLoP'99. We proposed these workshops under the umbrella title, "Using Patterns in the CS Curriculum".
Workshop 1, Incorporating Patterns into CS Courses, aimed to help computer science instructors explore how they might use existing patterns and pattern languages in their courses. After a short introduction, we spent most of the rest of the evening conducting a reader's workshop of Loop Patterns . Participants read the paper and the worked in small groups to identify ways they might use the patterns in their course. (They also provided useful feedback to the authors, who intend to include their suggestions in the next version of the paper.) The evening concluded with a large group discussion that integrated and expanded on the ideas of the small groups.
Workshop 2, Writing Patterns for CS Courses, aimed to help computer science instructors explore how they might begin to write patterns and pattern languages for their own courses. The group of participants was considerably smaller than for the first workshop, which enabled us to conduct a much more intimate and wide-ranging discussion. We spent most of the morning conducting a writer's workshop of Selection Patterns . In the course of understanding the paper and suggesting ways in which the author might improve it, we managed to discuss several critical issues in the writing and presentation of elementary patterns. As often happens with first-time participants at PloP, attendees who had never participated in a writer's workshop found the experience exhilarating.
Several elementary patterns papers appeared at the summer flagship patterns conferences. Joe Bergin took his Selection Patterns  paper from SIGCSE to EuroPLoP in July. At PLoP, we workshopped two papers: Dorin Sandu's and Dwight Deugo's The Lambda Pattern  and my Envoy: A Pattern Language for Managing State in a Functional Program . Lambda documents a pattern of on-the-fly behaviors as seen in Java inner classes and Smalltalk blocks. It draws its inspiration from Lisp's nameless functions. Envoy describes structures in functional programming for storing and modifying state. These structures rely on the idea of a closure, which itself is a nameless lambda expression. Dwight and I also reprised our PloP'98 birds-of-a-feather session on elementary patterns, at which we learned from graduate students and people from industry some of their ideas and concerns regarding the use of patterns in teaching and learning.
Many of the questions that I raised in last year's ChiliPLoP report on how to write and use elementary patterns remain unanswered, but the community of CS educators working on them has grown markedly since that time. We have made more progress on the task of writing patterns than we have on the task of capturing how to use them in the classroom. I think that this is a natural evolution: without patterns in print, we won't be able to explore their use in any great detail. In many regards, we proceed in the task of writing patterns on faith in their ultimate usefulness. I also think that, regardless of the answers we ultimate reach on their use in the classroom, we will be better teachers--and our courses will be better for students--for our having written the patterns at all.
I continue to host a web site as a resource for the elementary patterns community. The site contains pointers to elementary patterns and pattern languages, pointers to papers on how to use patterns in the classroom, and pointers to relevant conferences and workshops, as well as information on how to join the Elementary Patterns e-mail discussion list. The Elementary Patterns home page resides at:
We hope to hold an elementary patterns workshop again at SIGCSE'00, and we also plan to offer another Hot Topic workshop at ChiliPLoP'00. We sincerely hope that others in the patterns community, the academic CS community, and the OO practitioner community will join is in this effort to improve undergraduate computer science education. Some believe that the use of patterns and pattern languages could lead to a radically different way of teaching computer science. If you are interested in any way, please visit the Elementary Patterns home page, subscribe to the discussion list, and join us!
I thank the many participants of the Elementary Patterns community for their helping me to organize workshops, birds-of-a-feather sessions and other conference activities, for their pattern-writing efforts, and for their ideas. The work I report here is theirs.