Teaching Intro CS: What Worked, What Didn't

Teaching intro CS to students with no prior experience: what worked, what didn't, and the design choices behind it.

I taught an introductory computer science class first period, 7:30 to 8:25, for a full school year before my regular workday. The students had no prior programming experience. The constraint that shaped everything was not the curriculum; it was the fact that they were learning to think in a new notation before they had any intuition for what the notation was for.

The first thing I got wrong was assuming syntax was the hard part. It is not. A student can memorize for i in range(n) in an afternoon. What takes months is understanding why a loop is the right shape for a problem, and why a nested loop is sometimes the wrong shape. So I stopped front-loading syntax and started front-loading reasoning: state-machine demos on the whiteboard, where the class walked through a small automaton by hand before anyone typed a line. The notation came after the idea it represented.

The second thing I got wrong was hiding my mistakes. I started live-coding with my screen shared, and made a point of not cleaning up typos before the class saw them. The point was not performance; it was that mistakes are part of the process, and a student who has never seen an experienced programmer get stuck will assume getting stuck means they are not a programmer. That assumption kills more students than bad syntax ever did.

The practical work was unglamorous. I partnered with IT to install VS Code and configure firewall rules, because in a rural community the students otherwise had no real coding access at all. The tooling mattered less than the access: a machine that could run a Python interpreter was worth more than a polished IDE they could not open.

For project work, I pushed refactoring and upfront consideration of design patterns, but only after the students had written something that worked badly enough to feel the pain. Design patterns taught as vocabulary are memorized and forgotten. Design patterns taught as a fix for a specific mess the student just made tend to stick.

What I would do differently: I would spend more time on reading code before writing it. My students could produce programs but struggled to read unfamiliar ones, which is the skill that actually transfers to a job. I would also shorten the gap between "this works" and "this is clean," because by the time cleanup felt urgent to them, the semester was over.

The open question I left with: how do you teach flow reasoning to someone who has never debugged a program that ran at all? State machines helped, but I am not sure they scale to students who need concrete feedback faster than a whiteboard provides.