Course placement


Written by Keith Schwarz, edits by Cynthia Lee and others

Not sure of CS106B is right for you? Wondering if you should start with CS106A or CS107 instead? This is a collection of our usual advice to students who ask about selecting the course that's right for them. Of course, we are happy to provide further guidance, just reach out on the forum or in office hours.

CS106A: Start here!

CS106A is our first-quarter programming course. It teaches the widely-used Python programming language, with an emphasis on conceptual understanding of the fundamental building blocks of coding (in any language) and principles of good coding style. If you're interested in learning how to program a computer, this is the place to start. CS106A has no prerequisites – it's open to everyone! The course is designed to appeal to everyone from humanists and social scientists to aspiring hard-core techies.

If you've had some experience with coding, it can be hard to decide if CS106A or CS106B is the right starting point for you. If you've taken AP CS Principles (but not AP CS A / Java), we recommend that you start with CS106A. If you completed AP CS A, then CS106B is most likely the best match for you, although some students who feel unsatisfied with their high school AP CS A experience do start with CS106A.

We recommend that you take CS106A if

  • You are interested in learning the first fundamentals of how to program computers.

We recommend that you not take CS106A if

  • You have prior programming experience at a level comparable to an introductory college course (for example, if you scored a 4 or 5 on the AP CS A / Java exam).
  • You have significant prior programming experience and just want to learn Python as a second+ programming language.

We sometimes hear that students are concerned that starting in CS106A means being too far "behind" their peers to successfully complete a CS major, but this is not true at all. Nearly half of the CS department's bachelor's degree graduates each June got their start in CS106A, so you'll be in good company!

In the 2023-24 academic year, CS106A is offered every quarter.

Visit the CS106A website.

CS106B: Next step

CS106B is our second course in computer programming. It focuses on techniques for solving more complex problems than those covered in CS106A and for analyzing program efficiency. Specifically, it explores fundamental data types and data structures, recursive problem solving, and basic algorithmic analysis. It's taught in C++, but the focus is on conceptual understanding of algorithms. If you'd like a focused study of C++ the language itself, consider taking CS106L.

CS106B assumes you have programming experience at the level of CS106A, though you don't necessarily have to have taken our CS106A course. If you are experienced with basic control structures (conditions, loops), variables, arrays/lists, maps, and program decomposition, then you should be ready to take CS106B.

If you've had some experience with coding, it can be hard to decide if CS106A or CS106B is the right starting point for you. If you've taken AP CS Principles (but not AP CS A / Java), we recommend that you start with CS106A. If you completed AP CS A, then CS106B is most likely the best match for you, although some students who feel unsatisfied with their high school AP CS A experience do start with CS106A.

We recommend that you take CS106B if

  • You have prior programming experience at the level of CS106A.
  • You are interested in learning more about problem-solving with computers.
  • You've programmed before but have not seen recursion, data structures, or algorithmic analysis.

We recommend that you not take CS106B if

  • You already have completed equivalent coursework elsewhere.
  • You have taken AP CS Principles, but not AP CS A / Java.

In the 2023-2024 academic year, CS106B is offered every quarter.

Visit the CS106B website.

Optional add-ons to CS106B

We offer several courses that are designed to complement CS106B with additional material. None of these courses are required, and they do not count toward the CS major or CS minor requirements. However, if you’re interested in going deeper for your own enrichment, you may find them worth checking out!

Additional foundation support: CS100B

CS100B is an optional 1-unit companion course to CS106B that provides extra support to students from under-resourced backgrounds. It meets for an additional weekly section where students receive access to additional mentoring, in depth content review, and other study resources. It is part of the Pathfinders/ACE program jointly sponsored by the CS department and the School of Engineering. Enrollment is by application, read more at https://engineering.stanford.edu/students-academics/equity-and-inclusion-initiatives/undergraduate-programs/additional-calculus We accept applications from all students who believe they may benefit from participating in small active-learning sessions led by a highly trained graduate student.

C++ Language: CS106L

CS106L is an optional 1-unit companion course to CS106B that focuses purely on the C++ programming language. Unlike CS106A and CS106B, which focus more on general programming skills and fundamental programming concepts, CS106L is specifically designed to focus on language features particular to C++ and how to use the C++ programming language to solve problems. Although CS106L is designed as a companion course to CS106B, it's open to anyone with a comparable background.

We recommend that you take CS106L if

  • You have prior programming experience at the level of CS106B (or are currently enrolled.)
  • You are interested in learning more about the C++ programming language and the standard libraries.
  • You are willing to put in more work than is necessary for CS106B.

We recommend that you not take CS106L if

  • You want a deeper understanding of topics like recursion, data structures, or big-O notation.
  • You want to learn programming at the level of CS106B, but don't have the time to take those courses.

In the 2023-2024 academic year, CS106L is offered in Autumn, Winter, and Spring quarters.

Visit the CS106L website.

More adventures: CS106M

CS106M is an optional 1 unit add-on course to CS106B that explores supplemental material in a small discussion setting. For example, this year’s offering will likely cover topics like data compression, error-correcting codes, and digital signatures. The topics covered in CS106M will not be required by later CS courses, even if you are planning to major in CS.

We recommend that you take CS106M in addition to CS106B if:

  • You are currently enrolled in CS106B.
  • You are interested in exploring additional topics and deepening your study of the course material in a small discussion setting.
  • You are willing to put in more work than is necessary for CS106B.

We recommend that you not take CS106M if

  • You are concerned that you “need” to take CS106M to avoid falling behind everyone else.

In the 2023-2024 academic year, CS106M is offered only in Fall quarter.

Social Good: CS106S

CS106S is an optional 1 unit add-on course to CS106B that gives you a chance to work on programs for social good. The class brings in student groups, nonprofits, and local tech companies and is a mix of a speaker series and small project course. The course also teaches basic web development, but is not meant to be a stand-alone web development course.

We recommend that you take CS106S in addition to CS106B if

  • You are interested in exploring social good applications of computer science.
  • You are willing to put in more work than is necessary for CS106B.

In the 2023-2024 academic year, CS106S is offered in Autumn, Winter, and Spring quarters.

Visit the CS106S website.

Can I skip the intro courses altogether?

Many students entering Stanford today have had considerable programming experience in high school or from their own independent work with computers. If you are in that position, the idea of starting with a beginning programming course—even an intensive one like CS106B—seems like a waste of time. Your perception may in fact be correct. In our experience, there are somewhere between 10 and 15 students in each entering class who should start at a more advanced point in the sequence. Below we talk about some of these more advanced classes (CS107 and CS107E).

For most of you, however, the right place to start is with the CS106 series. Most high-school computing courses are somewhat weak and provide little background in modern software engineering techniques. By taking CS106, you will learn how the CS department at Stanford approaches programming and get a solid foundation for more advanced work. If you’re unsure where you should start the programming sequence, please talk with us.

CS107: How it all works

After completing the intro programming sequence, CS107 takes you under the hood to learn the ins and outs of computer systems. It explores how high-level programming constructs are represented internally inside the computer and how those internal representations affect program behavior and performance. Along the way, it provides programming maturity and exposure to developing software in a Unix environment.

CS107 has CS106B as a prerequisite and assumes an understanding of fundamental programming techniques and good programming style. As a result, it's rare for incoming students to jump directly into CS107 and to skip the CS106 series entirely. Typically, we'd only recommend this to students with a background comparable to CS106A/B and who already have good programming style. Most students, even those who go on to be CS majors, usually begin in the CS106 sequence.

We recommend that you take CS107 if

  • You have completed CS106B or have the equivalent programming background, including familiarity with recursion and fundamental data structures (binary trees, dynamic arrays, linked lists, graphs, etc.)
  • You have experience writing readable code – writing comments, decomposing problems into smaller pieces, etc.

We recommend that you not take CS107 if

  • You have never before taken a class in computer programming.
  • You have prior programming experience but have not met the postconditions of CS106B.

Visit the CS107 website.

CS107E: How it works, embedded

CS107E is version of CS107 that covers similar topics but which focuses on programming a small computer that can easily fit into the palm of your hand. The class is smaller and more project-oriented than CS107 and lets you play around with small embedded devices to see how low-level systems concepts directly let you control physical devices. The CS107E FAQ offers perspective on advice on choosing between 107 and 107E.

We recommend that you take CS107E if

  • You meet all the requirements for CS107.
  • You enjoy working on open-ended projects.

We recommend that you not take CS107E if

  • You're nervous about taking CS107 and want to satisfy that requirement in a different way.

Visit the CS107E website.