Motivated children learning to code (CSUF Photos)

Experts in any field don’t just know more; they also use different schemata for categorizing concepts and tasks. For example, chess masters understand games in terms of important configurations of pieces, instead of individual moves. Children who are experts on dinosaurs look at more fundamental properties when asked to describe a new kind of dinosaur, while beginners looked for size and color. Experts in physics sort phenomena by scientific principles like inertia, entropy, and friction, but novices look at literal features like the type of object that is moving and its size or shape.

The same idea applies to computer science. Novice coders classify programs by their superficial characteristics, and not by their deeper structure. This yields both consequences and opportunities that we need to keep in mind when teaching beginners!

Novice categorization matters for motivation.

Suppose you assigned students in a beginning programming class to find the longest common substring of two strings. This is an interesting algorithm question — enough so that it has its own Wikipedia page. Your students might have to work very hard to accomplish this task, but when they finally did so, they would be proud to have accomplished something pretty impressive… right?

Suffix tree for max substring (Joey-das-WBF, via Wikipedia)

Probably not. In fact, to a novice programmer, the problem probably sounds pretty easy. For the examples they will think of, they don’t even need a computer at all. Your novice students won’t have the combinatorial intuition that suggests this problem is hard. In fact, part of the reason this problem made it to Wikipedia is that it doesn’t sound hard.

You may find your students feeling inadequate, because such an “easy” task was difficult for them. Perhaps you can assure them that it really was an impressive problem to solve. You could show them the Wikipedia page, and show them people whose Ph.D. or tenure was earned by making a breakthrough on this task. They might understand, but alas, they probably won’t feel it deep inside.

Novice categorization presents opportunities, as well.

One you’re aware of this phenomenon, you can also use it to improve your students’ experiences. There are all sorts of opportunities for students to get excited about what they are doing, if you can get over that expert voice in your head, warning you that this doesn’t matter.

When I teach programming in middle schools using CodeWorld, we start by drawing circles and rectangles. The screen is set up as a coordinate plane.

A circle on the CodeWorld coordinate plane

In every class, there is a student who now announces that they are going to make a circle with a radius of one million! In expert mode, I want to stop them, and tell them to try reasonable numbers. But they would then learn that I don’t want them to try ambitious things — because to the novice, this is being ambitious. But in novice mode, I can get excited with them, and encourage them to try it. Of course, they don’t see anything at all, because the circle is outside the screen.

The first time this happened, I expected disappointment; but that’s not what I saw. They think it’s awesome that they made a circle so big it doesn’t even fit on their screen. Then someone says “Oh! I’m doing 999999999999999!” They know they aren’t going to see anything either, but just being able to tell a computer to do these ridiculous things is empowering, and they love it.

This doesn’t end on the first day. Later we animate shapes moving or spinning at different speeds. You guessed it: they want to shapes to move really fast. A million! Again, the result is not interesting to the expert brain, which screams “It will be off the screen after one frame!” and “Spinning that much faster than the frame rate will just break the illusion of motion, which depends on continuity!” These things don’t matter. Kids still think it’s hilarious and amazing. These are their favorite moments.

What would it mean to teach for a novice mindset?

These are just a few moments. What would happen if we reviewed our entire experience teaching introductory programming, and optimized it to motivate novices, who don’t yet have an expert schema for classifying tasks? I don’t know the full answer, but I have a few ideas.