Home

Description #

The goal of CS51 is to give you insight into the difference between programming and programming well. One and the same problem can be solved in different ways, and the different solutions can vary along multiple dimensions including correctness, readability, testability, maintainability, scalability, efficiency, and elegance. Optimizing across all these dimensions requires judgement, but pays off abundantly. Whether you’re writing code yourself, collaborating with other software developers, or vibe-coding with a coding agent, it’s crucial to know whether a program is written well.

Your ability to recognize well-written programs is directly related to the array of tools at your disposal. The course teaches fundamental concepts in the design of computer programs, emphasizing the crucial role of abstraction. You will learn to program in a variety of paradigms – including imperative (familiar from CS32 and CS50 but seen here in a more elemental form), functional, and object-oriented. The elegant multi-paradigm programming language OCaml is the ideal language for manifesting these ideas. Important ideas from software engineering and models of computation will inform these different views of programming. You should come out of the course not only a better programmer in any language, but also a better computational thinker, with a much broader range of tools at your disposal and ability to analyze the quality of programs.

CS51 FAQ for prospective students #

How can I get a sense of what CS51 is about?

We recommend starting with the course syllabus. After that, a good way to get a sense of the course content is to read the first few chapters of the course textbook, which was specifically written for this course.

Which should I take: CS51 or CS61?

CS51 and 61 are not alternatives, they are complements.

CS61 is a course on the fundamentals of computer systems programming and machine organization, introducing you to programming layers of increasing concreteness. CS61 moves down the abstraction hierarchy towards the hardware.

CS51, by contrast, is a course on programming tools that allow for increasing abstraction. CS51 moves up the abstraction hierarchy, expanding software design possibilities.

It makes sense to take both courses, as they complement each other. Of course, if you can only fit one in your schedule, either one is quite valuable. You may want to consider whether your own future software development projects will deal more with building lower-level systems or realizing and reasoning about higher-level applications.

CS51 is a course just about functional programming, right?

Nope. It’s true that functions are one of the most important of all programming abstractions, but only about half of the course deals with first-order and higher-order functional programming. The remainder of the course introduces a wide range of programming paradigms, including generic programming, imperative programming, lazy programming, and object-oriented programming. Throughout, we present a set of widely applicable formal tools for thinking about programming.

CS51 is a course about OCaml, right?

Again, no. OCaml is the programming language used in CS51 to introduce all of the many programming abstractions that you’ll be working with. The language is ideal for this purpose because it provides for all of the programming paradigms in the course in a single, well-designed language – one of the most influential programming languages around. But the point of the course isn’t OCaml. That’s just the means to the end.

I understand that 51 is taught mostly in the form of lab exercises based on textbook reading. I’m a visual learner, and prefer a lecture format. Should I take 51?

Yes. We recognize that different students have different learning preferences. Consequently, we provide optional supplementary video lectures for each of the readings. These complement and serve as a good introduction to the readings, but don’t substitute for them.

Of course, the bulk of the learning happens by doing. That’s why we emphasize lab work in the course. The best way to expand your programming horizons isn’t to listen to someone talk at you about programming. It’s to actually do some programming.

Don’t LLMs make programming obsolete?

No. The best LLMs for coding can serve as useful collaborators, but all of the dimensions of programming quality still hold when collaborating with an LLM. In the era of vibe-coding, it is increasingly important that you be able to recognize good code and proper use of abstractions when collaborating with an LLM just as you need to when collaborating with other human programmers. Indeed given the idiosyncrasies of LLM coding, it may be even more important. This is, by the way, why CS51 is the ideal preparation for CS1060.

Important notice about late enrollment #

Enrollment in CS51 once labs have begun (the second week of class) is restricted. Please read the late enrollment policy.