We Need to Rethink How We Teach Programming
Computer Science Educator
James Liu has taught introductory programming for 20 years at Stanford University. He's the author of 'Code First, Theory Later' and advocates for project-based CS education.
For two decades, I've watched bright, eager students walk into Introduction to Computer Science—and watched too many of them walk out defeated. Not because they lacked ability or interest, but because we've been teaching programming fundamentally wrong.
We start with syntax when we should start with problems. We focus on language features when we should focus on creative thinking. We grade algorithms when we should be celebrating working software.
The traditional approach to teaching programming goes something like this: spend weeks learning data types, control structures, and functions in isolation. Write dozens of small exercises that test whether you can implement a specific algorithm correctly. Only at the end of the semester, if you're lucky, do you build something that actually does something useful.
The Problem with Theory-First
This theory-first approach made sense in the 1970s and 80s, when computing resources were scarce and programming was the domain of specialists. Students needed to understand exactly how computers worked before they could write efficient code.
But we don't live in that world anymore. Computing power is essentially infinite. Libraries and frameworks handle the low-level details. The bottleneck is no longer processor cycles—it's human creativity and problem-solving ability.
- Students spend weeks learning syntax before building anything meaningful
- Abstract concepts are taught before students understand why they matter
- Assessment focuses on implementation details rather than working solutions
- Failure is punished instead of treated as a natural part of learning
A Better Way
What if we flipped the script? What if, on day one of intro programming, students built something they could actually show their friends—a simple game, a personal website, a tool that solved a problem they actually had?
This isn't just idealistic thinking. I've spent the last five years experimenting with project-first curriculum at Stanford, and the results have been dramatic. Retention rates are up 40%. Students report higher confidence and engagement. And here's the kicker: they actually learn the fundamentals better because they understand why those fundamentals matter.
Learning to code should feel like learning to play music—hard, yes, but joyful. The moment you make something work, something that didn't exist before, is magical. Our job as educators is to get students to that moment as quickly as possible.
The Stakes Are High
This isn't just about pedagogy. As software continues to eat the world, computational thinking becomes essential for everyone, not just future engineers. If we keep teaching programming as a gate-keeping ritual rather than an empowering skill, we'll continue to produce a tech industry that looks nothing like the diverse population it serves.
It's time for a change. It's time to put the joy of creation back at the center of computer science education. Our students—and our society—deserve nothing less.
What do you think of this opinion?
Dr. Sarah Mills
Professor Liu raises important points about engagement, but we shouldn't throw the baby out with the bathwater. Foundational concepts matter—students who skip them often struggle in advanced courses. Perhaps the answer is a hybrid approach that balances immediate gratification with long-term understanding.
January 18, 2026