Skip to main content Skip to secondary navigation
Main content start

Stanford Engineering offers free online introductory programming course

Code in Place teaches at scale utilizing hundreds of volunteers to lead small group breakouts.
Stanford faculty, Mehran Sahami and Chris Piech smiling for the camera in front of a photo of the Huang Building on the Stanford Engineering Quad.
For the third time, Mehran Sahami and Chris Piech lead the Code in Place effort to help more people around the world learn about computing.

Katherine Michel first learned about Code in Place through a tweet. It was early in the pandemic, and she was feeling stuck. Since graduating college, her various jobs included working as a research assistant, a project manager, and an events specialist. Her latest position was as an open source maintainer, but she wasn’t seeing a path to advancement. Code in Place changed all of that, Michel said.

Code in Place offers high-quality online programming instruction to learners around the world at no charge. Designed by Stanford faculty Chris Piech, assistant professor of computer science, and Mehran Sahami, chair of the Department of Computer Science, the six-week course is a model for scaled online learning: high-quality teaching on a large scale with small group interaction. The program engages a cadre of volunteer instructors to help run sections, allowing the program to serve thousands of learners while retaining the benefits of small group learning. No programming experience is required, only an interest in learning how to code and the time to dedicate to the online class. “Anyone can code,” explained Piech, who with Sahami leads the program.

First launched in early 2020 as a public service project, the goal of Code in Place is to share the joy of coding with more people around the world. Now in its third year, after a break in 2022, the program kicks off April 24.

The coding course is a modified version of Stanford’s popular undergraduate course CS 106A, redesigned to meet the needs of learners worldwide with little to no knowledge of coding. Hundreds of volunteers are recruited and trained to teach live sections in an interactive and learner-centric way. These sections, which accompany online lectures taught by Piech and Sahami, are kept small – no more than 10 learners each, to provide synchronous, personalized instruction and mentoring. The high number of volunteer instructors – over 2,100 in the first two years of the program – has allowed for roughly 22,000 learners to take part in the program since its inception. Another 12,000 people have applied to take the course this year; an additional 720 have applied to be volunteer instructors.

“We’ve discovered that almost as many people want to teach computer science as want to learn,” said Piech. “It’s inspiring how many are willing to devote countless hours volunteering for Code in Place.

The learners and volunteers interviewed said Code in Place has made a big impact on their lives. Michel said the program “was life changing.” Not only did it give her the fundamental skills she needed for her career, but equally important, she gained the confidence to aim higher. She reports she is now employed as a software engineer at JP Morgan Chase & Co. She was also inspired to become a volunteer section leader in the program.

Cameron Mohne, ’24, a computer science student with a minor in education, volunteered as an instructor in 2021. He said the program gave him an outlet to share the knowledge and experiences he is fortunate to benefit from at Stanford. He started at Stanford during the height of the pandemic when classes were online, and the limited social interaction made many students feel isolated. “Code in Place helped me personally get through that rough period by helping others,” he said. As a first-generation college student, Mohne said he’s especially passionate about giving back to others and supporting historically excluded communities.

The course uses Karel the Robot, an educational programming tool that emphasizes logic and structure. Learners solve seemingly straightforward Karel challenges that ultimately become more complicated with increasing numbers of test cases to be solved. “Karel is a great tool that forces your brain to learn the abstract,” Michel said. “It’s also just really fun.” Lessons and assignments explore simple Python, covering the topics of control flow, variables, expressions, functions, and parameters, as well as images, using a module called SimpleImage created by Stanford senior lecturer Nick Parlante. The course also includes a final project.

“It was really inspiring to learn from teachers who are passionate about the subject,” Michel said. “Not everyone is going to become software engineers after taking this course, but Code in Place teaches that persistence pays off, which is quite inspiring.”

Mohne said that Stanford’s program stands out because of the deep care Piech and Sahami put into it, from how the course is structured and taught to how participants interact and build a community. “The people you work with and the fundamental knowledge you get is incredible. Code in Place lets you gauge your interest in a powerful concept that can change your life.”

For Sahami, teaching in Code in Place is an acutely affirming experience. “Coming together as a community of educators to help spread the joy of programming to thousands is both humbling and uplifting,” he said. “It’s honestly been one of the greatest experiences I’ve had as a teacher.”

In addition to the free course offered through Code in Place, a 10-week version of CS 106A called Programming Methodology is available for academic credit through Stanford Online. Code in Place is hosted by the Stanford School of Engineering and supported by the Stanford Center for Professional Development, which manages Stanford Online. The Code in Place course is made possible, in part, by the generous support of Carina Initiatives.

Related Departments