DeCal Spotlight: Teaching Coding

8 MINUTE READ
| |

Learning to teach a DeCal class

Let me tell you about my DeCal experience and share perspectives from student instructors on what it’s like to get involved in teaching a DeCal. Last spring I took the Python Coding DeCal (also listed as Astron 98 003), a two-unit P/NP course taken through the Astronomy Department. This year, I’m learning how to teach it. 

I’m Milana Berhe, and I never coded before taking this course. I’m a second-year double-majoring in astrophysics and political science. I was worried about adding another class to my very heavy course load last semester (you can read about it in my Day in the Life!), but guidance from Brianna, Charlie, and the other instructors helped me pass this course. I’m now an intern for the DeCal, and gearing up to become a fully-fledged instructor next semester!

Me on a field trip to the Lick Observatory.

The basics of a DeCal class by students, for students

DeCals, or Democratic Education at Cal courses, are P/NP courses that any UC Berkeley student can take for the number of credits that specific course is worth. They can be classes about special interests—like Cal Pokémon Academy, a class about Pokémon—major or career related—like Introduction to Medical Cantonese—or anything else, really. New DeCal offerings are posted at the start of every semester in the course list on the DeCal website. Every semester, hundreds of DeCals are listed from all different departments. Whether it’s a class that’s highly encouraged by the department like the Python DeCal, a class that you take out of curiosity, or a course to put you over the unit threshold, DeCals are one of the most unique and exciting ways to receive an education at Cal. You certainly won’t regret it!

Teaching the Python DeCal

This DeCal was proposed by students in order to bridge a gap: Python (or coding in general) was not a major requirement, but it was very heavily utilized by upper division instructors. Since then, a team of about 8-12 instructors (and sometimes one or two interns!) run the course for up to 70 students, assigning regular homework and teaching basics, discussions, and review sessions. The course culminates in a final project, which students spend roughly a month working on.  

To emphasize, the class is completely student taught, seeing as it’s a DeCal, and no one is expected to have any sort of astronomy or coding experience coming into the course. This means it is available and accessible to anyone and everyone, welcoming students across all colleges and a wide variety of majors.

I asked a couple of my fellow instructors about their thoughts and experiences with the course. Here’s some background on them:

  • Brianna Peck is the current head instructor (as of Fall 2025) and double-majoring in astrophysics and physics. Brianna is quite involved in the Astronomy department. She runs another course in the Astron 98 series called ULAB (a chance for underclassmen to gain research experience with guidance from other student researchers), conducts research under Professor Jessica Lu, is an undergraduate representative in the Astronomy Department’s small council, and is an absolutely fantastic teacher for the Python DeCal.

Brianna and some of the instrumentation she worked on over the summer in Hawaii.

  • Charlie Tolley majored in astrophysics and graduated in Spring 2025. They’re currently a postdoc researcher under Aaron Parsons. They work with a radio astronomy group on campus called EIGSEP, looking for a signal that encodes important information from the birth of the first stars. They help build, calibrate and deploy their team’s telescope (designed right here at Berkeley) in a remote canyon in Utah, lifting it 100 meters off the ground to remove problematic interference. Back in my first semester of freshman year, Charlie was the one to encourage me to take this course, and I’m so glad they did!

Charlie on their trip out to the canyons in Utah to test their telescope.

Why should someone take the class?

We are Introduction to Python for Astronomers, but we also welcome students from all backgrounds. Especially now, computer science has exploded in popularity. Courses are over extended—students can’t even get in. A lot of classes and labs on campus require coding, so we’re a great way for students who have no programming experience to learn the foundations of coding, which are very applicable to a lot of students, even if the applications we teach are more astronomy and physics focused.” — Brianna Peck (Class of 2026)

How did you begin teaching the coding DeCal?

“I took the Python DeCal in my second semester of my freshman year. I became an intern in the fall semester of my sophomore year. Then I was an instructor, and later the head instructor from my junior year to my senior year.” —Charlie Tolley (Class of 2025)

Charlie’s path is the typical path! You can take the course at any point in your academic career at Berkeley (although it is recommended to be taken before upper division courses in the Astronomy Department!), and assume the position of Intern after taking the course. Finally, you can become an instructor after a semester of interning. This is one path you can take to getting an academic internship. This also provides undergraduate students with an opportunity to learn to teach, which is a valuable skill for careers in academia!

What was a valuable experience you gained from the Python DeCal?

“Seeing successful undergraduates teaching other undergraduates. I came into Berkeley and I knew I probably needed to do research at some point, but I had no idea how to start. Not to mention, my first physics class was insane, and I really, really struggled. So when I took the Python decal, it was really fun, because the undergraduates felt so close—they were only a couple years older than me. It felt really accessible, not like someone sitting at the front of a classroom and skipping 20 steps. They were holding my hand, telling me exactly how to do things.” —Brianna Peck (Class of 2026)

“I spent a lot of time working with the faculty to address some of the problems that they saw with the DeCal. We did a whole revamp of the curriculum at the request of the department. Faculty members asked that we narrow our focus to make the DeCal a little bit better tailored towards the upper division lab classes. I did a lot of work with them.” —Charlie Tolley (Class of 2025)

What is your favorite thing about the course?

“I love, love, love watching new generations come into the teaching staff and implement changes. I love watching the development of this class. A lot of academia stays static, and especially as AI grows and the landscape around academia changes, it’s really important to stay adaptable.

I also loved teaching the terminal. It’s a pain, but you start to be able to teach some of the problem solving skills that you need to code. On a more meta level, I really love teaching the problem solving skills that you need for coding, because it’s so different from all the other kind of topics that you’ll study at Cal. Problem solving with a computer is one of the most infuriating things you can ever do, because computers are so dumb and you are so smart, it’s impossible to truly understand what is happening in the computer’s brain. You have to go with the flow.”  —Charlie Tolley (Class of 2025)

As someone who ended up being quite an involved student in the course, the Python DeCal is one of the first ways I started building a small major/topic-specific community on campus. Since every instructor holds office hours at least once a week for the course, there are so many opportunities to speak with them one-on-one, ask for individualized help, and even befriend instructors—they are around our age after all!

How do you implement what you learned about coding or teaching?

“After I took the Python DeCal, I got a research position, and ever since I took that position, I code almost every single day. I run simulations, and that takes a ton of coding. I do coding for my homework now too—I don’t use calculators. I use Python just because I trust my Python. I can reuse old stuff that I’ve written before. It’s especially great in science classes because you can keep track of your units with some Python tools, which is really handy, because I always drop units.” —Brianna Peck (Class of 2026)

Class structure

The class meets twice a week for one hour (class is worth two units!). One class is typically lecture-style, where one instructor presents information on the week’s topic. The second class of the week will be a discussion follow-up to the lecture, where we work through practice problems individually or with partners, and check our work as a class. Homework is regularly assigned, and takes anywhere from 1-4 hours a week. As mentioned earlier, the course builds up to a final project, which can fit into the three categories of analyzing a dataset, creating an animation or simulation, building a video game, or another proposed and approved end goal!

What a homework problem might look like.

A little more about my experience

I took the Python DeCal in a spring semester, and this fall, I am an academic intern for the course, where I plan to continue my learning and eventually become an instructor. My final project fell under the “graphing” category. I tried to map the relationship between the mass and luminosity (how bright a star is) of over 30,000 main-sequence stars (most stars are on the main sequence), and compare it with the actual widely observed phenomenon called the Mass-Luminosity Relation. As can be seen in my results, the line of best fit I came up with did not match the predicted result, but this is part of the fun! The project taught me a lot of independent skills in coding, like debugging, self-teaching to fit your needs, and troubleshooting! Not to mention, I got some pretty unexpected and cool results.

Some of my final project coding and the results I achieved! The top image on the right was before I added 25,000 additional data points, and the bottom image is after.

If this all sounds like absolute gibberish, that’s completely ok!—my project was certainly one of the more astronomy-based projects of my cohort. Some other memorable final projects included a 3D snake game, orbit simulations, a space puzzle game, and more, can be viewed online to get a sense of what knowledge you might emerge from the class with. In the end, this is a class that is very versatile, not to mention applicable to most (if not all) majors, creative hobbies, and future careers.

I encourage you to broaden your horizons and take—or teach—a DeCal, especially in such a low-stakes, high-return environment. 

Milana Berhe, Class of 2028, is majoring in astrophysics and political science and minoring in creative writing. Cover photo by Adam Lau.

Want More?