Chris Piech on Why You Should Still Learn to Program in the Age of AI

Open on YouTube ↗
Overview

Chris Piech is a Stanford professor who teaches large introductory computer science courses and an intro to math for AI class. For six years, Piech has also run Code in Place, a free online course for learning to program. AI can now write code, do probability, and write essays, so should anyone still learn those things? Piech's answer is yes, and it draws on experiments the course has run with AI across those six years. Piech's position is that the next generation should become smarter than the current one, and that AI can multiply human ability but cannot replace the foundations or the motivation needed to build it.

14 min read

Code in Place: The Class With the Most Teachers

Code in Place is an online class for learning to program. Piech says what makes it unusual is its number of teachers: about 17,000 students and more than 1,000 teachers, or roughly one teacher for every 10 students.

The course began early in the pandemic. Piech was about to teach Stanford's flagship intro coding class and was told everything would move online. The team asked whether, while putting the class online, they could also do something to help a world that was suffering. They could simply post their lecture videos, but they believed outsiders would get far less from that than Stanford students did. According to Piech, the "special sauce" of Stanford's intro CS is the section leader: someone a little older and a little further along who takes time to help you grow. Code in Place was built to reproduce that at scale.

The course uses Karel, a small robot that lives in a grid world with compass directions and is controlled in Python. A clip from the class shows Karel being told to turn left three times in place of a right turn, which the robot doesn't have.

Enrollment Doubled After AI Coding Tools Arrived

Because the course has run for six years, Piech has seen it both before and after tools like Cursor and Claude Code. The first observation Piech offers is that enrollment roughly doubled. Rather than turning people away from learning to code, the arrival of AI coding tools coincided with many more people wanting to learn.

Piech then widens the question. "Should I learn to program?" is the same kind of question as "Should I learn probability?" or "Should I learn to write?", since AI can do all of those. The wrong answer, Piech argues, would be "no." People should still learn to formalize an argument, understand probabilistic reasoning in depth, and program. If AI can do those things, a person's abilities may be magnified, but Piech expects it will still matter to be smart in those areas.

What Six Years of AI Experiments Showed

Piech calls it a common misconception that AI tutors will solve everything. AI tutors basically exist already, Piech notes, but they haven't "moved the needle" the way people expected.

Across six runs of the course, the team experimented with giving learners different "dosages" of AI. Piech calls the result surprising. When learners were simply handed a chatbot and told to use it to learn, they predictably dropped out and became demotivated. Piech's conclusion is that it is demotivating to have AI thrown at you at the wrong moment in your learning. The team has since found what Piech describes as "very nuanced ways" of using AI that do help people learn, though the talk doesn't detail them.

The contrast was with human contact. In one setup, a student working in Code in Place might see a pop-up saying a teacher is online and would like to spend 10 minutes with them. Students who accepted were 10 percentage points more likely to complete the course.

One might assume the humans were saying the right things and the AI the wrong ones. Piech says the team examined the conversations and found otherwise. The AI was correct and was not hallucinating, at least for intro programming, while the humans were not always correct. Piech attributes the difference to motivation: the human touch is special. Actually doing the thinking yourself, rather than letting Claude do it, takes extra energy, and everyone needs something to convince them to spend it. Piech calls motivation the "crown jewel" of education. It works much better, in Piech's experience, to tell a student: I care about you being a smart person, I'm not giving up on that in the age of AI, let's work on your foundations, and once they're solid I'll teach you how to code with AI.

Chatbots Answer Questions but Don't Inspire

Piech thinks chatbots answer questions well, and poses a challenge to anyone designing them for education: how do you get them to inspire? Piech sometimes inspires students deeply by doing something they didn't ask for. A student comes to office hours and Piech asks, "Hey, do you want to see something really cool about probability?" and shows them something neat that had nothing to do with their question. Piech hopes to "flip the switch" so the student becomes so curious they can't help but learn and spend the rest of the day thinking about the problem. Once that curiosity is lit, Piech believes, the student will get there.

Current chatbots, in Piech's view, rarely do this. Nobody opens ChatGPT and gets asked whether they'd like to see something that will blow their mind. A teacher can do it because they know roughly where students are and where they're trying to go, so they can carefully choose the example or challenge. Piech warns that treating AI tutors as the solution to clarity can miss the bigger piece of the puzzle.

A Motivational Crisis Among Students

Piech says they are seeing more students in a motivational crisis than in the past and finds that understandable. A working professional can ask what they can contribute alongside the AI of 2026. A student starting a four-year program faces a harder question: what jobs will exist in 2030, when AI is four years more advanced? Piech says they empathize with that uncertainty a great deal and think it naturally leads to motivational problems.

Piech also stresses that predicting jobs five to ten years out has always been hard, and people have always gotten it wrong. As an example, Piech recalls being a PhD student around 2011–2012, when a now-colleague was reaching some of the first major milestones in self-driving cars. Watching those cars, people wondered what would become of taxi and truck drivers. Instead, Piech says, the trucking profession has kept growing at a healthy rate. Piech doesn't claim to know what trucking's future holds and allows that an inflection point may come. But Piech argues people underestimated several things: valuable cargo needs a responsible person, and highways have a long tail of unusual situations. Ninety-nine percent of experiences may be the same, but the remaining one percent is very hard for AI to master. Piech expects that one day all cars will be driven by AI, but was surprised by how grossly people overestimated how quickly that would happen.

Outsourcing Thinking and Staying Self-Aware

Piech believes anyone who has worked deeply with AI has felt that outsourcing a lot of thinking to it separates them from problem-solving. Piech codes with AI a lot but already knows a lot about programming and architecture. Without that knowledge, Piech says, AI starts making poor decisions that may not show up in a first prototype. Five weeks later, when students are actually using the tool, they may hit strange bugs, and someone who doesn't understand the architecture can't help them.

Piech frames the risk as a question every student has felt. If AI writes too many of your essays, at what point can you no longer write one? If AI writes too much of your code, at what point can you no longer handle the critical architecture work? Piech's advice is not to avoid AI. Using it is fun and people should play with it. But they should stay self-aware about whether they are growing alongside the AI, and care a great deal about their own growth.

What Actually Matters When Learning to Program

Piech splits learning to program into two parts. One is syntax: how to tell a computer to do things. The other is problem-solving: breaking big problems into small pieces, setting things up so data can talk to algorithms, and thinking about algorithms. Piech expects AI to get very good at syntax, so memorizing every command matters less in the future. Problem-solving probably matters more, and learners should focus on it.

Piech also argues coding is an especially good way to learn problem-solving because it gives immediate, falsifiable feedback. If your logic is wrong, the program doesn't work, you see it, and you can iterate quickly. In life, by contrast, you can make a poor decision and the feedback comes so slowly that you never get to practice improving.

How to Become a High-Contributing Engineer

Asked how someone becomes a strong engineer, Piech gives what they admit may be an unsurprising answer: time on task. What counts is how much time you spend actually creating things, and Piech distinguishes creating things yourself from handing them to Claude Code.

Piech also describes what they would do as a young person today. They would build many prototypes with Claude Code, then ask it to explain the most important things it did to create each one. Iterating that way, they would gain a lot of experience and work out which concepts matter most.

An Opportunity for Junior Engineers

Piech calls this a confusing time but also one with an opportunity that didn't exist before: barriers to entry have dropped. A 12th grader and a friend might now build a high-quality startup with an impressive codebase that solves an interesting problem.

Piech sees a real art to knowing which problems are worth solving: what is worth building, what users want, and which feature will help them move forward. The ability to connect what computers can do with what humans actually need has always been a critical high-level skill. Piech thinks more junior engineers now get to practice it and advises them to start now rather than waiting until they are senior.

You Can't Skip the Foundations

Piech's argument about foundations starts from a premise: your children, or your nieces and nephews, will become smart people, and the next generation will be smarter than we are. The question then is how to get them there. Most subjects, such as probability or computer science, have foundational concepts with layers of complexity built on top. If you expect people to surpass you, Piech says, it's very hard to skip the foundations.

The analogy is multiplication. Calculators have multiplied for a long time, yet children still learn multiplication. Piech notes a subtle distinction: understanding what multiplication is matters enormously, while quickly answering "what's 13 × 7?" matters less. So the foundations can't be skipped, but teachers can be more deliberate about what within them to emphasize.

Starting the Day With an Axiom

Piech takes it as an axiom that they are not giving up on the next generation. In Piech's experience, the people who get most lost and demotivated in the AI era are sometimes those who overthink it. Piech describes a student who was doing wonderful work: using AI, solving problems, learning a great deal. When Piech asked what the student was thinking about, the student said they didn't really think about the future of AI, and that this let them thrive. Piech, who says they think about AI perhaps ten times a day, was struck by the simplicity of just being curious and learning. Since then, Piech starts each day with the axiom. They don't ask why they care about the next generation becoming smarter; they take it as true, want it, and work toward it.

Piech describes AI as a tool that multiplies humans. At our best, we can use it to multiply ourselves. A doctor who really cares about patients can do more, faster and more accurately. A teacher who is passionate about students' learning can go further with them. Piech also says that seeing young people's self-awareness and critical thinking, and watching them blossom, is a source of optimism.

Background: How a Curious Student Became a Professor

Piech was born in Nairobi, Kenya, moved to Kuala Lumpur, Malaysia at 12, and came to the US for university. Piech says they weren't set on becoming a professor; they were simply curious and liked interesting problems. Arriving at Stanford with a little coding but not really knowing how to program, Piech took a programming class to fill an elective. The teacher challenged everyone to build the most wonderful thing they could with only the first two weeks of material. Piech was so excited that they put about 40 extra hours into the challenge on top of normal coursework. Later, Piech became curious about how people learn and decided professor was the right path.

Closing: Go Make Stuff

Piech's final advice to young people is to have self-awareness and set the goal of becoming smarter. "Chris is not giving up on you, you should not give up on yourself either." Piech has two children under five and says they will live in an awesome world: people will adapt and figure things out, and children will still be curious and grow their minds.

Piech suggests the top engineer may not be the person who knows all the code, but the one who can translate real-world human problems into apps, data science, and research. The message is to go make things people use and love, because in that process of iteration you can become excellent at coding and at problem-solving. Piech ends by recommending one axiom to start each day with: you will become smarter than you were yesterday.