"I want to make THAT." The promise of creative coding

Mark Sawula has been a member of Peddie's math department since 2006. Last summer, he was the recipient of a National Science Foundation (NSF) mini-grant to continue to explore the teaching of creative coding as a way to broaden the appeal and accessibility of computer science. 

Background: Sawula submitted a proposal to adopt a CS1 course with Creative Computation in Processing and was awarded $3,000 to support his course development and evaluation efforts. The mini-grant, one of only four awarded to high school teachers, was part of a larger NSF grant. The principal investigators of the larger grant, affiliated with Bryn Mawr College and Southern Methodist University, sought to present the design and development of a new approach to teaching the introductory computing course (CS1) at both the college and high school levels using the context of digital art and creative computation. 

The following is an excerpt from Sawula's report to the grant committee:
This spring, Sawula invited Diana Xu, a principal investigator
of the grant and chair of the department of computer science
at Bryn Mawr College, to visit Peddie and have lunch
with female students interested in STEM fields.

In September 2011, before the initial meeting of my first course built around creative coding, a female student walked into the room, picked up a copy of Casey Reas and Ben Fry’s Processing: A Programming Handbook for Visual Designers and Artists, and started flipping through its pages. Her eyes seemed to grow bigger and bigger, moment by moment, page by page. About two-thirds of the way through the book, she smiled, pointed to an abstract pattern, and declared “I want to make that.” 

As an educator who had spent most of his time teaching math, this was a jaw-dropping event. I don’t remember a student ever doing anything remotely like this with a math textbook. This young woman had no prior interest in programming and the course hadn’t even started yet. This was the promise of creative coding at its purest. At times, the work seemed intrinsically motivating.

This and other similar episodes led me to believe that I could create an introductory programming course driven by engagement. I tried to design assignments that had nearly universal emotional appeal. I added elements of “borrowed interest” wherever I could and swallowed any pride I had about pandering. The first sketch, which developed mastery of basic Processing drawing commands, became an invitation to recreate with code a drawing you might have made in kindergarten. The introduction to iteration began with a reminiscence of string-art-style doodles popular in middle school notebooks. Loops were married with conditionals in an assignment to mash-up a favorite cartoon or logo with another image using a variation of a green-screen technique. Those interested could make stickers of their images and affix them to their laptops. On another assignment students took an mp3 of a favorite song and created a music visualization. They made proportional symbol and choropleth maps of either personal data or data of interest to them. Often students felt that we weren’t doing much work because most of the assignments were so playful, and the progression of concepts so natural.

When I learned of the creative coding project by Bryn Mawr College and Southern Methodist University, I thought I was a natural fit. I had been pursuing what I regarded as creative coding for about five years. I was curious to meet other educators committed to this approach. I was also interested to learn how academics described creative coding in the language suitable to formal, federally-funded research.

The vision of creative computation
The principal investigators of this research, Dianna Xu (Bryn Mawr College), Ira Greenberg (Southern Methodist University), and Deepak Kumar (Bryn Mawr College) envision a new kind of introductory computer science course (CS1) with activities which seem more at home in the arts than in applied math. Quotations are from Xu, Greenberg, Kumar, and Wolz (2016), “Creative Computation for CS1 and K9-12.”

“The ultimate goal is to radically recontextualize computer code – from an applied math notation to a creative medium, on par with charcoal, paint, clay, etc. Creative coding is an exploratory and aesthetically driven approach, where students build visual designs and artworks iteratively as they expand their programs.”

The primary rationale behind this move is to broaden the appeal and accessibility of computer science. It engages students who do not identify with traditional STEM subjects. So far the courses are successful at making CS1 more popular with female students as well. Students seem to understand computing concepts on a deeper level and are more likely to pursue further study in computer science.

Clearly this focus on engagement resonated with my efforts over the past five years. I also had a conviction that creative coding not only broadened the appeal of computer science, but also made it possible to reach all students. I wanted to help develop a high school curriculum infused throughout with computational thinking. 

"I envisioned a near future in which students would be as adept at writing code to create an image for art class, a map for history class, or a simulation for physics class, as they were at writing essays for any of those subjects."
Three edifying missteps
My quest to extend the applicability of coding to other high school subjects led me to make three missteps through reflection upon which I gained deeper understanding of the benefits of creative computation.

1. My initial creative coding course was ostensibly a Statistics course designed to provide a math option for our weakest math students in their Senior year. I tried to build the curriculum by weaving strands from data science with those from creative coding, but adding statistics to the programming sequence seemed to overwhelm most students.

2. Liberated from the requirement to integrate statistical and computational concepts, I thought that I could finally teach a creative coding course that treated code as a creative medium. I would take my cue from the AP Art Studio course and students would use code to create pieces exploring elements of artistic composition like unity/variety, balance, emphasis, rhythm, repetition, proportion/scale, figure / ground relationships. However, many of my students had little experience in the arts and found the combination of these two subject areas overwhelming.

3. At the summer workshop associated with this grant, Darby Thompson of Sidwell Friends School shared that she begins her introductory programming course by asking students to program personal robots using Python. They then transition seamlessly to the Java flavor of Processing. Darby’s success inspired me to try a similar switch between Python and Javascript, though at a different place in the curriculum The allure of p5js for me was the potential for students to easily share their work on the web. While students loved being able to make programs that could be run in browsers on their friends’ phones, many of my weaker students found the transition from Python to an environment with HTML, CSS, and Javascript more than they could handle.

What all of these examples have in common is the sense that I overloaded my students to the point where the easy and natural sequence of CS1 topics was disrupted. In each case, students struggled to learn computing concepts if they had to learn something else concurrently, whether that was statistics, aesthetics, or new syntax.

A framework: Fast and slow thinking
As I was reflecting on these teaching experiments, I was reminded of Daniel Kahneman's 2011 book: Thinking, Fast and Slow. Kahneman is a cognitive psychologist who won the Nobel Prize in economics for his foundational contributions to the field of behavioral economics. He and Amos Tversky conducted a series of psychological studies exposing biases people have in making rational judgments (especially those involving statistics). The assumption of rationality is key to classical economics and so their research was of great significance to the field.

Thinking, Fast and Slow is Kahneman’s overview of his work for a general audience. Key to his thinking is a distinction between thinking that is automatic, fast, easy, and intuitive (System 1) and thinking that effortful, slow, and precise (System 2). People have limited reserves of “mental energy” and prefer to get as much done with System 1 as they can, only engaging System 2 as needed. System 1 is better at recognizing superficial patterns and relationships; System 2 is better at deeper, analytical thinking. System 1 is notoriously bad at statistical thinking.

I laughed out loud when I read about the challenges of statistical thinking. This explained the sense I had that asking students to learn statistics at the same time they were learning to program was too much. I was asking them to engage System 2 on two fronts.

Apart from the insight about the challenges of statistical thinking, at this point System 1 and System 2 seem to be adding only a bit of jargon to the notion that I had overloaded my students. I believe there is a much deeper insight to be gleaned about creative coding from use of this framework.

You may recall that the principal investigators reported “a deeper understanding of foundational computer science concepts” among their students and attributed this to higher motivation connected with “personal interests and creative expertise.” I think that this creative expertise is actually cognitive expertise. Two of the mainstays of System 1 thinking, are perception and pattern matching. Creative coding tasks allow students to engage in fairly sophisticated thinking about patterns while mostly engaging their Systems 1. They can understand the programming assignment, they can set goals for themselves, they can improvise and iterate, all without taxing System 2. 

"According to this viewpoint, creative computation is the perfect way to manage cognitive workload at the start of a student’s programming odyssey when every line of code requires effortful thought."
The framework also argues for the utility of mapping out the outline of a program (or at least a high-level description of its requirements) so that working memory does not need to keep track of it. I was at a Computer Science Teachers of New York meetup recently and Meredith Towne, a drama teacher at the Academy for Software Engineering (AFSE), presented on the use of Scratch in her 9th grade drama classes to animate a blocking scheme for a scene in a play. Her students had already mastered the fundamentals of Scratch necessary to the task and enjoyed applying their skills to a new domain. In order to make the blocking task clearer, she first had her students create Post-It flipbooks animating the scene. Eric Allatta, a computer science teacher at AFSE, commented that the flipbooks would be wonderful in his computer science classes to help students plan out animations. He remarked “we’re always trying to get things out of their heads.” For me this is equivalent to converting a possibly high-load System 2 task of keeping a model of the animation in mind to a low-load System 1 task of perceiving what’s in the flipbook. It enables the students apply more of the focus where it is needed in thinking about the animation in a procedural way.

You can probably tell that I’m finding this lens for looking at computational tasks new and exciting. I’m thankful to this research project for exposing me to new ideas, connecting me to new people, encouraging me to conduct new experiments, and forcing me to reflect on all of these with greater acuity. It was a great experience!