Jul 30, 2026

Stanford CS Professor: AI Can Code. That's Why You Should Learn

Interview with Chris Piech, Stanford CS Professor & Creator of Code in Place

The Thinking Mode

0:00 / 0:00
💡
At a Glance
  • Who: Chris Piech, a Stanford computer science professor who co-created Code in Place, the free intro-to-programming course now taught by more than a thousand volunteer teachers to 17,000 students a year.
  • What: Over six years, he's run repeated experiments giving Code in Place students different doses of AI, studying how it affects their motivation and ability to learn.
  • Lesson: Piech breaks down why you should still learn to code when AI already can, why motivation has always been education's real bottleneck, and the axiom he says we owe a generation built to be smarter than us.
Chris Piech, a Stanford computer science professor, created Code in Place to help thousands of people learn programming for free. Here, he makes the case for why you should still learn to program when AI can already do it, why motivation is the hardest problem in education right now, and the one axiom he thinks we owe the next generation.
He's also launching Probability for Artificial Intelligence (pai.stanford.edu), a free Stanford course on the math behind AI.

7 Key Takeaways:

Why "The Crown Jewel of Education Has Always Been Motivation"
When Code in Place students got a popup offering a real teacher instead of a chatbot, their odds of finishing the course jumped 10 percentage points, even though the AI wasn't wrong. The human touch is special because it's motivating, and motivation has always been education's crown jewel.
Why Current Chatbots Aren't Igniting Curiosity
Piech says today's chatbots answer questions well but rarely make a student curious enough that they can't stop thinking about a problem all day. The moment he can flip that switch as a teacher, curiosity does the rest of the work, and he doesn't see AI tutors doing it yet.
We Always Overestimate How Fast New Tech Takes Over
Piech points to self-driving cars: the first milestones hit in 2011, and everyone assumed trucking was finished, yet the truck driver profession kept growing instead. He thinks students face a similar overreaction now, since uncertainty about the future has always existed, but AI just makes it feel more urgent.
Are You Also Growing Alongside the AI?
If you let AI write too many of your essays or too much of your code, there's a point past which you can no longer do that architecture work yourself. Piech's test for using AI well is simple: are you still growing alongside it, or just outsourcing the growth away?
What's Actually Worth Learning If AI Can Write the Code?
Learning to program splits into two skills, syntax and problem-solving. AI is about to master syntax completely, so the only skill worth optimizing for now is breaking big problems into pieces it can execute.
The Real Skill for Junior Engineers Is Knowing What's Worth Building
Piech says writing code stopped being the bottleneck once an 18-year-old and a friend could ship a codebase that used to take a real team. What's always mattered more is the intersection of what computers are capable of and what humans actually need, and that's the skill junior engineers should start building now.
Just Be Curious. The Next Generation Will Always Be Smarter.
Piech's favorite student thrives by refusing to think about AI's future at all, staying curious about the problem in front of him instead. That's the same instinct behind his daily axiom: don't ask why the next generation should be smarter, just take it as a truth worth working toward.
Watch the full interview now on EO's YouTube channel! Below is the complete transcription of the interview. Minor edits have been made for clarity and readability.

Introducing Chris Piech

Chris Piech, CS professor at Stanford. Courtesy of EO
Chris Piech, CS professor at Stanford. Courtesy of EO
Chris Piech, CS professor at Stanford. Courtesy of EO
Hi, 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, is 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. There's about 17,000 students and more than a thousand teachers. We've been doing Code in Place for six years. 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? 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 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 four-year program, I have to think about what jobs are going to exist in 2030 when AI is four years more advanced, and that's a lot of uncertainty for students. 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? That's a really critical piece. I think all students have felt like this. 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? I suppose that's the part where 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 whether you're also growing alongside the AI. You should care so much about your own personal growth.

Can AI Make You Want to Learn?

How Code in Place Began

I was born in Nairobi, Kenya. When I was 12, I moved to Kuala Lumpur, Malaysia, and 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. When I came to Stanford, I'd done a little bit of coding, but I really didn't know how to program. 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 two weeks of programming." I found myself able to put 40 hours of extra work beyond my normal schooling into this challenge because I was so excited. Eventually I discovered that I was so curious about how people learned, and I decided professor was the right thing for me.
How Code in Place's interactive learning works. Photo by Code in Place
How Code in Place's interactive learning works. Photo by Code in Place
How Code in Place's interactive learning works. Photo by Code in Place
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 a thousand teachers. 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've been told that everything's going to be online.
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.

What Six Years of AI Experiments Taught Us

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. Over the last six years, we've now done this six times. We've tried a lot of different experiments where we gave people different dosages of AI, and we have learned something very surprising. If we just give people AI, 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 contrast that with humans: 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 popup that 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. You must be thinking, oh, the humans must be saying the right things and the AI must be saying the wrong things. We've looked at these conversations: the AI was correct, and it wasn't hallucinating, not for intro programming. 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. To actually do the thinking yourself takes extra energy.
How a simple human touch can dramatically change the response of the student. Courtesy of EO
How a simple human touch can dramatically change the response of the student. Courtesy of EO
How a simple human touch can dramatically change the response of the student. Courtesy of EO
The 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 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: it could be like you come into my office and I say, "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 love and that inspiration. 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. When I look at current chatbots, they are not igniting curiosity that much. It's not like you never show up to chat, it's like: hey, do you want to just see something that is going to make your mind explode, that will 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.

Why Now Is the Best Time to Learn Coding

Photo from Reddit
Photo from Reddit
Photo from Reddit

Why We Keep Overestimating How Fast AI Takes Over

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 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 four-year program, I have to think about what jobs are going to exist in 2030 when AI is four 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 out, people always get it wrong.
Here's an interesting anecdote though. I'm an old man now. But when I was young, during my PhD, one of my now-colleagues was making some of the first major milestones in self-driving cars. This was back in 2011, 2012. At that moment, you would see this car drive and 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 an inflection point. But there were a lot of reasons that people underestimated. They underestimated that if you have valuable cargo, you need a person who's responsible, or there's the long-tail sort of experience: there's always something different happening on the highway. 99% of the experiences can be the same, but that 1% of things that are different, it's so hard to have an 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 overestimate how quickly we get there.

What's Actually Worth Learning Now

I think everyone who's worked deeply with AI has had this experience of, by outsourcing a lot of thinking to AI, getting more separated from problem-solving myself. A good example right now: I program with AI a lot, but I happen to know a lot about programming and architecture. 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 five 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? That's a really critical piece.
I think all students have felt like this. 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? I suppose that's the part where 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 whether you're also growing alongside the AI. 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: 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. 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. If your logic is wrong, your thing doesn't work, and you get to see that and 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. There's a couple of things about coding that make 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 time on task: how much time are you spending actually creating things, versus 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.

The Challenge for Junior Engineers

I'll give 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 entry have been cut: you could be a 12th grader, an 18-year-old with a friend, and you might be able to make a high-quality startup. The two of you could make a pretty impressive codebase 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: what is worth actually making, what do users want, what's the feature that will help them make progress in whatever their problems are. That ability to interface between what computers are able to do and what 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.

Start With This Axiom: The Next Generation Will Be Smarter Than Us

Professor Piech. Courtesy of EO
Professor Piech. Courtesy of EO
Professor Piech. Courtesy of EO
If you start with the premise that my children will become smart people, and your children will become smart people too. 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? You look at any subject, probability, computer science, and you'll find 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.
One way of thinking about that is we've had calculators to 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, if I ask you what's 13 times 7, go quick. That's not as important as just knowing what is multiplication. But you can't skip the foundations, though 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." That gave me pause. I think about AI all the time. I feel like I think about AI 10 times a day. And then the simplicity of, like, 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. I also get to see young people all the time, and I would say that gives me inspiration. Seeing their self-awareness, how critically they're thinking, 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 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.

Join the 1.5M+ founders inbox
to get the latest updates.

Explore more