If learning to code were like learning to write…

If learning to code were like learning to write, we’d start with words, first teaching children what a token is and how to read them. “Madison, look at that billboard, see the ‘if’? That’s a token in a lot of programming languages.” “Daniel, did you know that the numbers you practiced writing in kindergarten today are called ‘integers’? Python has integers too. They’re a sequence of digits. Want to go tokenize some digits while we shop at the farmers market?”

If learning to code were like learning to write, we’d move onto sentences, teaching children how to parse statements. “Look Madison, I brought you a new book from the library called ‘Python and other beasts’. Let’s read the first page: ‘print(‘ssssssss!’)’. Can you read those tokens? What kind of tokens are they? That’s right, an identifier, a parenthesis, a string, and another parenthesis. Together, they make a function call, which has a name, and a list of arguments. Good job!”

If learning to code were like learning to write, we’d next teach children how to read sentences, showing children how computers execute them. “Want to play computer Daniel? I got a new board game for us. It’s like the game Simon Says: you read a statement and you try to do what the computer is going to do. If you do it exactly like the computer does, you stay in the game, but if you do something different, you’re out. Check out this card, it says: ‘secret.index(“treasure”)’. Want to play?”

If learning to code were like learning to write, we’d next teach children how to read short books, giving them programs to read, exposing them to all of the computational possibilities of the language they were learning. “Madison, what did you choose for your book project this month? Oh, an Instagram post indexing algorithm, interesting! Are you liking it? What’s your favorite idiom?”

If learning to code were like learning to write, we’d ask children to start writing sentences, creating simple statements that accomplish small tasks. “Daniel, we keep forgetting to turn the light off in the garage. Can you log into the IoT portal and write a rule that turns it off every night at 9 pm?”

If learning to code were like learning to write, we’d then ask kids to write short essays, scaffolding their problem solving with design patterns for various genres of computational problems. “Okay, before you leave, let’s discuss your homework for this week: I want you to write a simple Python script that takes President Trump’s Twitter feed and finds all tweets that denigrate a person, place, or thing. I’ve provided the list of tweets that do this, so your job is to find an algorithm to do this automatically. This is classification problem, so the last two weeks of content should set you on a good path.”

If learning to code were like learning to write, kids would go to college and participate in writing workshops, doing code reviews with each other to improve their encapsulation, clarity, performance, and other software qualities. “Madison, I really like this abstraction here; its so simple, but you’ve managed to use it everywhere, reducing a lot of boilerplate and probably preventing a lot of defects. I bet if you added some polymorphism to this function you could simplify it even further”.

Unfortunately, with today’s computing education, learning to code is nothing like learning to write. Computer science never teach students about words. They give a few examples about grammar, but nothing comprehensive. They never teach students how to read, expecting them to pick it up independently. Then, on week two of intro CS, they immediately ask students to write whole essays. Its no wonder so many students are overwhelmed and drop out.

feedback, learning, and massive open online courses

INSC 541 feedback session

A snapshot from INSC 541, one of the design methods classes that I teach.

As a professor in higher ed, I’ve been thinking a lot lately about massive open online courses (MOOCs), and in particular, how they differ from modern classrooms in higher ed. For a while now, I’ve been quite certain that there are crucial benefits to teaching in physical environments, but we just haven’t been able to articulate what they are. After a lot of thought and observation, I’ve decided that while there are significant differences in the teaching affordances, in practice, most higher ed classrooms are nearly identical to MOOCs, except in scale, where MOOCs win hands down.

Why? It all comes down to feedback. (This shouldn’t be surprising come from me, since nearly everything I think about as a researcher has to do with feedback). I believe strongly, as does the rest of learning sciences and psychology, that feedback is a fundamental part of learning and understanding. Without it, people are left to make sense of the world in a vacuum. And the opportunities for feedback in most higher ed classrooms are simply not that different from those posed by MOOCs.

Consider your standard 150 student lecture course. Let’s take CS1 as an example and imagine the best possible delivery of this kind of instruction. Such a course would have a sage on the stage, lecturing about for loops and variables; you might even have innovative classroom practices such as peer learning or quizzes every 10 or fifteen minutes. At best, students get immediate feedback on quiz results and perhaps even automated feedback on homework assignments. A few students may even be bold enough to ask questions in class or make it to office hours for additional help. If the course uses peer learning, they’ll get some corrective feedback from their peers, which can help greatly. In this setting, the real value is access to these limited instructional resources offered by the instructor and the TAs. Ultimately, however, the vast majority of these 150 students receive little, if any, personalized instructional feedback from experts.

Now consider a CS1 MOOC, like those offered by Coursera and Udacity. The central structure of these courses is nearly identical: a sage on the stage imparts wisdom in brief chunks; students get feedback through automatically graded quizzes and homework assignments. Self-motived learners use this feedback, and the guidance of their fellow students via discussion boards (ala peer learning), to understand and correct their own misconceptions. Like the students in the physical classroom, they are largely on their own, unless they are resourceful enough to solicit feedback from peers, instructors, or other online resources.

The big difference with a MOOC are that many more students can be taught and that automatic, immediate feedback (even if it’s suboptimal to an individual human tutor) is guaranteed (whereas it is not in most physical CS1 courses). It’s no wonder higher ed instructors are scared. For a course of the same kind, the physical version has almost no advantages over the online one!

But this doesn’t have to be. There are a huge number of affordances that physical classrooms offer that no online course can match. First and foremost, the walls and surfaces in classrooms, and the throughput of face to face communication, offer vastly superior means with which to view and critique student work. The image above, for example, shows a design methods class that I teach to Ph.D. students. We constantly use the walls to post work and facilitate peer critique and because I can see all of the discussion that are happening, and overhear how well each is going, I know who needs help and when and can quickly connect students who are struggling with similar ideas. None of this is possible online because the channels of communication are too few and to serialized.

Another instructional affordance that is still absent online is laughter. Don’t laugh! I’m serious. In my brief experience as a teacher, I’ve come to view laughter as a crucial part of motivating students who aren’t already self-motivated. Finding ways for students to interact in physical space, and giving them opportunities to not only discuss and work through ideas, but comment on the very discussion of them in humorous ways, creates motivational bonds in students that I’ve yet to see happen in MOOCs. There are simply too many people and too few identity cues to create these types of motivating relationships.

There is one major caveat to this line of reasoning: just because physical classrooms have these affordances doesn’t mean they are useful or valuable to teaching all subjects. A student taking a medical terminology course, where their sole job is to memorize and understand thousands of medical terms, is probably much better off with an online drill and practice mode of instruction and skip the physical classroom. In the same way, it’s likely that online courses will always be infeasible for a Chemistry lab: there’s simply too much physical infrastructure and safety concerns to imagine students either creating their own lab or finding a local one, in which to perform experiments.

The real challenge then for us in higher ed is to figure out what forms of instruction really do require or strongly benefit from physical space and focus on those. Tear out the rows of desks and replace them with flexible walls and surfaces. Invest in course release so that faculty can learn how to utilize these physical affordances. Give faculty whose expertise is in something best delivered online the time and incentive to create outstanding versions of these courses that benefit both students and their home universities, but also students anywhere in the world. This future isn’t one where universities disappear, but one in which we faculty finally start taking teaching seriously. It’s about time we had a little competition to give us the clear feedback that the status quo isn’t good enough (except online).