“Quacking” into computer programming

New AI bot helps students learn to code

A large balloon shaped like a yellow rubber duck next to a crowd of students at a Harvard computer science festival in Cambridge

The yellow rubber duck is the class mascot for CS50, which this semester also integrated an artificial intelligence chatbot called the CS50 Duck to help students check their code (Eliza Grinnell)

Harvard students enrolled in CS50, which teaches the fundamentals of computer programming for a range of languages, had some special help with their final projects this year — an AI chatbot called the CS50 Duck.

Beginning last summer, course instructors began to integrate a suite of artificial intelligence, including the “CS50 Duck,” software built atop a large language model that helps students check their code and find answers to questions related to their coursework. The Duck is named for the class mascot, a yellow rubber duck, an allusion to “rubber duck debugging,” whereby new programmers are encouraged to talk through their programming problems with, in the absence of a fellow human, a rubber duck.

David J. Malan, Gordon McKay Professor of the Practice of Computer Science at the Harvard John A. Paulson School of Engineering and Applied Sciences (SEAS), who teaches the course, first deployed the tools with a small group of students this summer before integrating them into CS50 sections this fall.

“The Duck was my best friend,” said first-year student Hannah Nguyen, who took CS50 this past semester. “I loved the Duck. The Duck helped me a lot when my code wasn’t working out. If one or two lines weren’t clicking, I used the Duck.”

“Whenever I had to resort to the CS Duck, it was super helpful,” said Sang Won Kang, a Doctor of Design candidate at the Harvard Graduate School of Design (GSD). “It never explicitly gives you the answer to anything you ask, but it guides you.”

In December, the students presented their final projects — made with the Duck’s help — at the annual CS50 Fair in the basement of the Northwest Science Building.

Topics ranged from games and social media to business and medical aids. Collin Fullen, a fourth-year student studying biomedical engineering, integrated impact sensors into a sneaker. His project wirelessly transmits the sensor data to a Python script, which then visualizes the data to help runners to help runners track how hard and where their feet hit the ground.

“Foot strike is super important for form, especially in sprinting, so I was trying to think of ways to implement my computer science and biomechanics lessons,” Fullen said. “This proof-of-concept lays the groundwork for allowing you to train foot strike for athletes.”

Two male Harvard students standing beside a laptop at a computer science festival in Cambridge

For their CS50 final project, Doctor of Design students Ryan Otterson and Sang Won Kang built the “Wall Maker,” which designs window and wall layouts to help architects optimize energy-sustaining capabilities in different climate zones (Eliza Grinnell)

A male Harvard student holding up a sneaker at a computer science festival in Cambridge

Collin Fullen's CS50 final project was a series of sensors embedded into a sneaker that can measure foot strike (Eliza Grinnell/SEAS)

Ryan Otterson, also a Doctor of Design candidate at GSD, and Kang teamed up to design “Wall Maker,” an architectural aid. By selecting specific climate zones and building classifications, the website designs a window and wall layout to optimize energy-sustaining capabilities.

“We wanted to make a tool for architects, designers and contractors to simplify the process of understanding the layers of construction that are necessary to conserve energy,” Otterson said. “A lot of the interesting research going on right now in architecture is in the development of tools that enable us to do high-performance design. Architects are so used to thinking intuitively about design, so when it comes to data and specific things that impact performance, we need these tools.”

One advantage of an AI tool like the CS50 Duck is its availability. Students could get help late at night or on the weekend, and no longer needed to pause their coursework for potentially several days until the next in-person office hours. Malan said that did reduce attendance during office hours and questions asked via their Q and A platform, but those more traditional forms of assistance are still available for students who prefer them to a chatbot.

“Hopefully it’s a good thing and signals that students are getting the help they need,” Malan said. “We certainly haven’t cut back on in-person opportunities – if anything, we can spend more quality time with the students who are coming and want that attention.”

A female Harvard student next to a laptop displaying a virtual globe of the Earth

First-year student Hannah Nguyen with her CS50 final project, a virtual globe with information on the New Seven Wonders of the World (Eliza Grinnell/SEAS)

A laptop displaying toast popping out of a toaster, and the same image appearing on a mobile phone screen nearby

“3Depot,” by computation design graduate student Ariel Adhidevara, is a 3D modeling aid for architects. (Eliza Grinnell/SEAS)

Ariel Adhidevara, a computational design student at GSD, took CS50 to gain a more fundamental understanding of the programming languages underlying his field. He described the Duck as “very helpful,” as it knew the course’s problem sets well enough to help him figure out  solutions without ever giving him actual solutions. For a final project, he designed “3Depot,” a 3D modeling aid for architects.

“This is the best course I’ve ever taken,” he said. “It’s very fundamental and important. CS50 taught me about the fundamentals of programming, from basic languages like C and growing to more complicated ones like Python. Understanding computational thinking is really important, and I think CS50 did a good job of that.”

Topics: Academics, AI / Machine Learning, Computer Science

Press Contact

Matt Goisman |