Main content start

Teaching Ethics in Computer Science: A Personal Journey Through the Classroom and the Research

Photo of Louie Ortiz, a man with dark hair, a goatee, and glasses
Image caption:

Louie Ortiz

In my first upper-division Data Science course, during a lecture about data bias and sampling, we were presented with a question to discuss: What proportion of students in the class identify as female? 

Murmurs filled the grandiose lecture hall, but the sentiments that I overheard were anything but subtle. “Why should I care about this?” and “I thought I enrolled in data science, not gender studies” were among several remarks that stuck with me.

I didn’t have the language for it then, but that was the first time I recognized a pattern I’d keep running into. My classmates treated the tools we were learning about as value-neutral, and the people they affected were seen as a distraction from the “real” learning material.

My early 20s were spent as an undergraduate student in UC Berkeley’s Data Science program, coming from a low-income background, and the first in my family to pursue higher education. I was often among the few in my program who had personally experienced the downstream repercussions of the technologies we were learning to build. For me, these harms weren’t abstractions, but a lived reality. My peers' apathy toward these consequences was hard to ignore.

This experience shaped my conviction that ethical reasoning does not belong at the margins of technical learning. It also made the default trajectory for Berkeley STEM graduates, like venture capitalist or software engineer at a large tech company, feel like a role I hadn’t chosen for myself. What drew me instead was the opportunity to deepen my understanding on how technical education could take social responsibility seriously, as part of the field itself.

After my time at Berkeley, I arrived at the McCoy Center for Ethics in Society to conduct research related to Embedded Ethics, an education program that integrates ethics directly into computer science (CS) coursework at Stanford. Embedded Ethics aims to help students understand the ethical issues that arise during technological development and prepare them to reason through value tradeoffs they might face in their careers. For example, consider a scenario close to one that students encounter in one of the existing Embedded Ethics modules:

A programmer is developing a content moderation tool for a social networking platform, writing the rules that govern which voices get flagged and removed. The programmer must first define the problem: is harassment a matter of intent, impact, or a behavior pattern? Then, they translate that definition into weighted variables. 

This is a tension between descriptive design (i.e. how harmful speech actually manifests online) and normative design (i.e. encoding what “should be” removed).  The descriptive question can be studied through observation and measurement, but the normative question requires making a judgement call about whose voice matters, what harm is tolerable, and whose safety takes priority. That verdict gets built into the system by whoever writes the rule.

In this scenario, a decision that once passed through a team of human editors is now often made by an automated system, displacing the human discretion that once shaped those judgment calls. On platforms with millions of users, that kind of choice determines whether harassment is caught or missed at scale.

So who is responsible for that threshold? The answer eventually points back to the people who create these systems, and by extension, to the engineers’ training. It’s a question that has motivated my work for the past two years and is central to the Embedded Ethics curriculum – helping students reason through normative tradeoffs and build with accountability to the people affected.

The research I’ve conducted investigates how the Embedded Ethics curriculum shapes students’ ability to identify and respond to value-laden design choices in technology. This work was motivated by something more personal for me: an assumption, born from my own experience, that underrepresented students (defined by ethnicity, gender, or first-generation status) who are most vulnerable to these technologies would navigate these decisions more fluently than their non-underrepresented peers. I felt so adamant about this belief because the same harm one student can theorize about, another has had to navigate firsthand. I wanted to see if the data also reflected that gap.

Instead, survey results from students in Embedded Ethics courses found no significant differences in self-reported ethical reasoning skills between underrepresented and non-underrepresented students. This result challenged my hypothesis, but the finding remains meaningful, suggesting the program is serving students equally. 

What the data does show is that the program is working as intended: as students take more courses with Embedded Ethics modules, they report greater confidence in reasoning through ethical problems and place high importance on communicating about such issues. The program, which has been operating for six years now, has shown that ethics can be taught without sacrificing technical rigor. 

As I think about the next stage of my research, I am eager to understand the impact of interventions like Embedded Ethics over time, and for different student groups. What pedagogies are most effective for CS students overall across diverse student populations? I’m also curious whether underrepresented and non-underrepresented students arrive at similar reasoning skills through different paths, for instance, whether lived experience of harm and hypothetical conceptions of harm function as equally effective but distinct routes to ethical competency, and what that might mean for how we teach.

How do we build structures that sustain ethics learning as faculty and institutional priorities shift? I also want to know whether students carry the ethical reasoning they build in the classroom into their careers. That means following them from their first CS course to graduation and beyond. It also means reckoning with the structural barriers like institutional power and constrained sense of agency that can make that reasoning harder to exercise, even to a student who believes in its importance.

Disregard for ethical reflection in technological innovation has real stakes. Students who are attentive to these issues are better equipped to navigate the dilemmas that arise, treating such judgement calls as requirements for successful development. The technologies they go on to create will define the conditions of life for many, but that responsibility shouldn’t fall on students alone. Institutions elect whether ethics is required or treated as an afterthought, and whether it’s built into the core curriculum or siloed into an elective course for those who happen to care. The students of today will be deciding what is built tomorrow, and they deserve an education that takes that seriously.

Louie Ortiz was a Tech Ethics and Policy Rising Scholar at the Center from 2024-2026, and is now pursuing a Masters degree in Policy, Organization, and Leadership Studies at the Stanford Graduate School of Education.