Chris Piech on Why You Should Still Learn to Program in the Age of AI
EO KoreaChris 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.
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.
Hi, you all. I'm Chris Piech. I'm a professor here at Stanford University. I teach some large intro to computer science classes, some intro to math for AI.
Code in Place, if people don't know it, it's an online class where you can learn to program. And the special thing about Code in Place is that it's the class in the world with the most teachers, and there's about 17,000 students and more than 1,000 teachers. We've been doing Code in Place for 6 years. So, we did Code in Place before Cursor and Claude Code and Code in Place after. A few observations. One, our enrollment basically doubled. Oh my gosh, all these people want to learn how to code.
You can expand the question. You could say, "Should I learn to program?" You can also say, "Should I learn probability?" Like AI can code, but AI can also do probability. "Should I learn to write?" AI can write. I think the wrong answer would be, "No, no, no." We're not giving up on the next generation being smart. Yes, you should learn how to formalize an argument. Yes, you should learn the depth of probabilistic reasoning. And yes, you should learn how to program. If AI is able to do those things, your abilities may be magnified. But I imagine in the future, it will still be important to be smart in those spaces.
I'm seeing more people with a motivational crisis than I have in the past, and that makes sense. There's more uncertainty in the world. You know, you can think about, "What can I contribute with AI of 2026?" But I think students are faced with a much harder problem of thinking about, "Well, if I'm starting a 4-year program, I have to think about what jobs are going to exist in 2030 when AI is 4 years more advanced." And that's a lot of uncertainty for students, and I empathize with this quite a lot. I think naturally that leads to some motivational problems.
When am I actually getting something out of AI, and when have I given away too much of the growth? I suppose, if I start outsourcing, at what point will I no longer be able to do that? Like that really critical piece. I think all students have felt like this. Like if you have AI write too many of your essays, at what point are you no longer able to write an essay? If you have AI write too much of your code, at what point can you no longer do that valuable piece of the architecture? So, I suppose that's the part where like I think it's fun to use AI. I think people should be playing around with it, but you should be self-aware. And you should be self-aware of like are you also growing alongside the AI? And you should care so much about your own personal growth.
I was born in Nairobi, Kenya. When I was 12, I moved to Kuala Lumpur, Malaysia. I ended up coming to the US for university. I was just a curious human. I wasn't set on being a professor from day one. I just like learning and I liked interesting problems. And when I came to Stanford, I'd done a little bit of coding, but I really didn't know how to program. But like I had to fill an elective, so I just had to take a class.
And I was like, okay, I'll do the programming class. And my teacher did the most wonderful thing. They said, "At this point, I'm going to have a challenge. Everyone in class, go make the most wonderful things with what you've learned in the first 2 weeks of programming." And I found myself able to put like 40 hours of extra work beyond my normal schooling into this challenge because I was so excited. And then eventually I discovered that I was so curious about how people learned, and I decided professor was the right thing for me.
So, Karel speaks this thing called Python, which we're going to be using as our programming language throughout the course. So, Karel is our lovable robot, and Karel is in a world we think of the world as kind of having a north, west, south, and east, and having compass directions. Turn on, Karel. Turn left. And then turn left. And then turn left. And we got out of the grid. Turn right.
It's the class in the world with the most teachers. There's one teacher for every 10 students, and there's about 17,000 students and more than 1,000 teachers. So, what problem was I trying to solve?
Let's go back in time. It's early days in the pandemic. I'm about to teach Stanford's flagship intro to coding class, and I'm been told that everything's going to be online. And in this moment, we're thinking, "The world is suffering. While we're putting the class online, is there something that we can also do to help the world?" We can just put our videos online, and we thought people might get a little bit out of it, but we know that it would be a lot less than what our Stanford students get, because our Stanford students get the special sauce of Stanford education. And the special sauce of Stanford education for intro CS is you get a section leader. You get somebody who's just a little bit older than you, a little bit further along in their career, who's going to take time to help you grow.
One of the common misconceptions is just thinking that AI tutors will solve everything. We basically have AI tutors already, but that isn't moving the needle in the way people expected. So, over the last 6 years, so we've now done this six times, we've tried a lot of different experiments where we gave people different dosage of AI, and we have learned something very surprising. If we give people AI, and just like, "Here's a chatbot. Use it to learn." Predictably, people will drop out. People get demotivated. It is demotivating to have AI thrown at you at the wrong moment of your learning.
We have found very nuanced ways where we can use AI that actually helps people learn. But if you can contrast that with humans. So, if I throw AI at you, you're probably going to become a little bit demotivated, statistically. But what happens if I throw a human at you? Imagine you're just programming in Code in Place. You might get a pop-up, and it says, "Hey, there's a teacher online, and they'd like to spend 10 minutes with you. Do you want to talk to them?" If you hit yes, your probability of completing the course goes up 10 percentage points. So, you must be thinking, "Oh, the humans must be saying the right things, and the AI must be saying the things." We've looked at these conversations. The AI was correct. It wasn't hallucinating, not for intro programming, and the humans weren't always correct.
But, the human touch is special. It's motivating, and I think we all need motivation right now. Everyone needs something to convince them, I'm not going to make Claude do all the thinking for me. Like, to actually do the thinking yourself takes extra energy. Crown jewel of education has always been motivation. And it's a lot more motivating for me to say, I care about you being a smart person. I'm not giving up on you being a smart person in this time of AI. Let's work on your foundations, and then when you're done with your foundations, I'll teach you how to code with AI. That works so much better.
When I look at chatbots, I think they do a good job of answering my question. But, one challenge I would pose to anybody thinking about how to make these work better for education is, how do you get it to inspire? Sometimes, I will inspire my students in a deep way. And it could be like, you come into my office and be like, "Hey, do you want to see something really cool about probability?" And I just show them something really neat, and they weren't even thinking about that. That wasn't the question they came in with. But, then they feel that like love and like that inspiration.
And as I said, if I can flip the switch of getting the student so curious that they can't help but learn. Like, the rest of the day, all they can think about is the problem that I just posed to them, or that cool thing I showed them. If that curiosity gets ignited, then I feel like they'll get there. And when I look at current chatbots, they are not igniting curiosity that much. It's not like... You never show up to ChatGPT and it's like, "Hey, do you want to just see something that is going to make your mind explode that will like, you know, pull you in?"
Now, as a teacher, I can do that because I have some context on my students. I know largely where they are and largely where they're trying to go. So, I can be very delicate in the choice of the inspiring example or the inspiring challenge to pose to my students. If you just think an AI tutor will solve the clarity problem, you might miss the bigger piece of the puzzle. And I feel like if we leverage this, we can have a nicer world.
I'm seeing more people with a motivational crisis than I have in the past. And that makes sense. There is more uncertainty in the world. You know, you can think about what can I contribute with AI of 2026, but I think students are faced with a much harder problem of thinking about, well, if I'm starting a 4-year program, I have to think about what jobs are going to exist in 2030 when AI is 4 years more advanced. And that's a lot of uncertainty for students, and I empathize with this quite a lot.
In 5 to 10 years, many things will change. The future has always been unpredictable. It's always been the case that if you ask people to project what jobs will be the right jobs 5 to 10 years, people always get it wrong.
Here's an interesting anecdote, though. So, when I was young, I'm an old man now. But when I was young, I was in my PhD, it's around the time that one of my now colleagues was making some of the first major milestones in self-driving cars. And this is back in like 2011, 2012. And at that moment, you would see this car drive, and you'd think, "Oh my god, what does it mean to be a taxi driver, or what does it mean to be a truck driver?"
But in fact, what happened is the truck driver profession has been growing at a very healthy rate. Now, I don't know what the future holds for truck drivers. Maybe one day we'll come to inflection point. But there is a lot of reasons that people underestimated. They underestimated like, well, if you have valuable cargo, you need a person who's responsible. Or the long tail sort of experiences. There's always something different happening on highway. 99% of the experiences can be the same, but like that 1% of things that are different, it's so hard to have a AI master all of them. I think one day eventually we'll have fully self-driving cars, and we'll live in a world where all our cars are driven by an AI system. But what I was surprised about was how grossly we overestimated how quickly we'd get there.
I think everyone who's worked deeply with AI has had this experience of by outsourcing a lot of thinking to AI, I am getting more separated from problem-solving myself. A good example right now is I program with AI a lot, but I happen to know a lot about programming and architecture. And if I don't know a lot about programming architecture, AI will start to make some poor decisions, which I might not experience the first time I make a prototype, but like 5 weeks down the line when students are actually using my thing, they might start to hit weird bugs. And if I don't understand the architecture, I can't help them.
I suppose if I start outsourcing, at what point will I no longer be able to do that? Like that really critical piece. I think all students have felt like this. Like if you have AI write too many of your essays, at what point are you no longer able to write an essay? If you have AI write too much of your code, at what point can you no longer do that valuable piece of the architecture? So I suppose that's the part where like I think it's fun to use AI. I think people should be playing around with it, but you should be self-aware, and you should be self-aware of like are you also growing alongside the AI? And you should care so much about your own personal growth.
When you're learning how to program, largely you can separate into two pieces. One piece is you're learning the syntax of how do we tell computers to do things, and the other thing you're learning is basically problem-solving. Like how do you take big problems and break them down into small pieces? How do you set it up so that data can speak to algorithms? How do you think about algorithms? So, I only want to say AI is going to get really, really good at just the syntax. It's less important in the future that you've memorized every command. It's probably more important that you know how to problem-solve. So, while you're learning to program, really focus on that problem-solving ability.
There's one thing about coding that's special. You get immediate falsifiable feedback. Like if your logic is wrong, your thing doesn't work and you get to see that and you get to iterate quickly. Whereas if you apply problem solving to life, you could make a poor decision, but the feedback cycle is so slow that you don't get to practice getting better and better at making decisions. So there's a couple things about coding that makes it particularly good at teaching how to problem solve.
The question, how do you become like a really high contributor engineer? You might not find my answer that surprising, but it's like it's time on task. It's like how much time are you spending actually creating things? And I'm going to separate you creating versus you giving it to Claude Code. Now, by the way, you know what I would do if I was a young person? I would make a lot of prototypes with Claude Code and I'd say, Claude Code, teach me all the most important things that you did in order to create this and I would iterate that way and I'd get lots of experience so I can try and figure out what are the most important concepts.
I'll give you young engineers a particular challenge. As I said, it's a confusing time, but there's an opportunity that didn't exist before. One of the things that's happened is barriers to entries have been cut. You could be a 12th grader, so an 18-year-old with a friend, you might be able to make a high-quality startup. The two of you could make a pretty impressive code base that solves an interesting problem.
There is a real art form to knowing what is a valuable problem to solve. And I think more and more junior engineers get to engage with that art form. Like what is worth actually making? What do users want? What's the feature that will help them make progress in whatever their problems are? So that ability to interface between what are computers able to do and what do humans actually need has always been a critical high-order skill and I think if I were a junior engineer, I would start working on that skill now. I wouldn't wait till I was a senior engineer.
If you start with the premise that my children will become smart people, and your children will become smart people. If you don't have children, then maybe your nephews and nieces will become smart people. You start from the premise that the next generation will be filled with people who are smarter than we are. Then, you're like, "Okay, how do we get them to that point?" And then you look at any subject, probability, computer science. And when you look at any subject, there's often foundational concepts, and then you'll have layers of complexity built on top of it. If you expect them to become smarter than you are, it's really hard to skip the foundations.
And one way of thinking about that is we've had calculators do multiplication for a long time. Kids still need to learn multiplication. Now, there's a subtle difference. The concept of multiplication is so critical, but actually knowing how to do the rote, you know, if I ask you like, "What's 13 * 7? Go quick." That's not as important as just knowing what is multiplication. But you can't skip the foundations, but you can maybe be more artful about what you focus on.
I kind of take it as an axiom that I'm not giving up on the next generation. Honestly, the people I've seen get most lost and most demotivated in this mode of AI are sometimes the ones who are overthinking it. I had a student, he was just doing such wonderful things. He was using AI, he
was solving problems, he was learning amazing things. I asked, "Hey, wonderful student, what are you thinking about?" And he says, "I actually don't think about it. I don't really think about the future of AI, and that allows me to thrive."
And then he paused. I think about AI all the time. I feel like I think about AI 10 times a day. And then the simplicity of, "No, I'm just going to be curious and learn." Since that day, I start my day with the axiom. I don't ask why I care about the next generation being smarter, I take it as a truth. I want this, and I will work towards it.
It's a tool, and it will multiply humans. So, when humans are at our best, we can use this tool to multiply us. Like the doctor who really cares about their patient now has a tool that they can do more, faster, more accurately. The teacher who really cares about their students, who is passionate about them learning, they can go further with their students and they can do more.
Also, I get to see young people all the time. And I would say that gives me inspiration. Seeing their self-awareness, how critical their thinking, I was seeing them blossoming, it gives you optimism. If I was a young person right now, the most valuable thing is that you have the self-awareness. You should also have the goal that I will become smarter. Chris is not giving up on you, you should not give up on yourself either.
I have two kids under five. And you know what? They're going to live in an awesome world. We're going to adapt, we're going to figure things out. They're going to still have curiosities, they're going to still grow their minds, and we're going to keep every day working towards that.
The top engineer might not be the person who knows all the code. Maybe the top engineer is a person who can relate the real world human problems into the world of apps, into the world of data science, and into the world of research.
So, go make stuff. Make stuff that people use, make stuff that people love, and in that process of iteration, you have an opportunity to become excellent at coding and excellent at problem solving. Just take axioms. You will become smarter than you were yesterday. Start your day like that.
Article published
