Showing posts with label teaching. Show all posts
Showing posts with label teaching. Show all posts

Friday, August 12, 2022

CS content inclusivity guide

First of all, I am not an expert in diversity and inclusion. However, I have tried over time to learn more about how to improve my Computer Science curriculum to be more inclusive, and I have noticed what makes me personally feel excluded from other CS curriculum. I wrote this guide based on my experiences at Khan Academy (online programming courses) and UC Berkeley (CS 61A, 169A), and have shared it privately with UC Berkeley TAs and other CS teachers. I'm now sharing it publicly in case it's helpful for other CS educators.

Once again, I am not an expert, so I encourage everyone interested in inclusive CS content to learn more from others, like at the CSTA or SIGCSE conferences.

Avoid sensitive topics

There are many topics which can trigger emotional reactions in people. If you are specifically teaching those topics, then you can present those topics with the appropriate context and create a space where students can process their reactions. However, if a sensitive topic just happens to be the theme of a problem but isn't necessary for the skill being assessed, then it is usually a good idea to avoid the topic entirely and pick a different theme.

Common sensitive topics

Violence/Death. Unnecessary violence / military violence is often the theme of video games and frequently makes it into CS assignments as well. Some specific examples:

  • Hangman: A classic game but pretty horrific, especially when you learn about America's recent history of hanging men. You can instead call the same type of game "Word Guesser", and show a visualization like eating a cupcake.
  • Free Bacon: A rule in the 61A Hog game (which has since been renamed). Since bacon is derived from dead pigs, this can be considered an instance of death. Non-pork eating students may find it strange to implement such a function.
  • Ants vs. SomeBees: A 61A game where ants kill bees (which isn't scientifically accurate) and which includes function names like death_callback and ants like the TankAnt. This project still exists, but the hope is to either replace it or provide alternative projects of equal difficulty (since many students don't mind insect destruction).

Current events. A lot of current events are emotionally charged for the people affected by them- wildfires, pandemics, protests, political elections. Some specific examples:

  • People's Park. CS61A has an old midterm review question about People's Park, a park in Berkeley that is the subject of controversary. The question did not specifically bring up the history and the current protests around it, but students could still find it distracting, especially on an exam, since it could bring up a lot of their feelings about the issues.
  • Swain v. Alabama: An example used in the Data 8 textbook of bias in the jury selection for a Black man on trial. The example wasn't presented with the full historical context behind the conviction, and could easily lead to stereotyping and stereotype threat. It is difficult to bring in an isolated example of racism if you haven't fully delved into the racist history leading to that event.

Memes. Memes can be funny, but the humor can often be at the expense of someone or some group of people. For example:

  • "Karen": A 61A exam review question initially used a function named karen in an environment diagram problem about anti-maskers, based on the "karen" meme. We actually have students named Karen in our class, and I would hate for them to feel made fun of or singled out due to sharing a name with the meme. The function has since been renamed.

Harry Potter. This is a common enough theme that it's worth addressing specifically. Lots of people seem to love Harry Potter and injecting HP references, but there are two problems:

  • The author's political views: JK Rowling has publicly stated many views that are transphobic, so seeing Harry Potter references can remind students of those views and threaten their feeling of belonging. CS61A used to have Potter references in an OOP assignment but changed it in 2021.
  • Assumed cultural content: Not everyone has seen Harry Potter, so assuming that everyone has can alienate those who haven't, since they aren't in on all the references. Khan Academy used to hold a Harry Potter themed company hackathon for many years, and I was always perplexed by the many references throughout the week (like the houses), but they finally changed the theme in 2020.

Historical figures. Quite a few of the inventors of the past (and even the present) have held views that are racist, sexist, or discriminatory in some fashion. If you do mention a specific historical figure in the content (either as the theme or because they invented a theory), first research their views and see if they have publicly espoused discriminatory views. You might then decide to remove the mention of them, de-emphasize them (versus their invention), or acknowledge the impact of their views. For example, Isaac Newton came up with theories in support of scientific racism, so physics departments have started to call his physics laws the "fundamental laws of physics" versus "Newton's laws".

Cultural relevance

Something has cultural relevance if it relates to our culture in some way, helping us connect CS topics to the rest of our lives and society. However, we have a diverse student body and may not share the same cultures. Thus, in a class of mixed cultures, there are several aspects to making content more culturally relevant:

  1. Check what culture your content currently assumes.
  2. Remove unneeded assumptions about cultural knowledge
  3. Diversify the cultural connections in the content

Step 1: Audit the default culture

Generally, the default culture in US content is White, European, Heterosexual, Male.

For example, 61A has many Shakespeare quotes in the textbook, lectures, and assignments. Shakespeare is certainly not the only poet in the world, and his poems don't make a ton of sense unless you've studied them. However, there's an assumption that everyone knows/likes Shakespeare if they're in the US.

Screenshot of a textbook chapter about Python that starts with a Shakespeare quote

Here's another example from a tutorial I made for Khan Academy, where I assumed that our mascot Winston would of course get married to a woman and have some kids. Now, as someone who's made the decision to not get married but am too nervous to tweet that in a marriage-normative society, I sure wish I had made a different choice!

Screenshot of a JS program that assigns a wife to a Winston object

Of course, lots of people do like Shakespeare and lots of men and women do get married, but it's too easy to write content in such a way that assumes that as the universal truth and does not make space for non-default culture.

If you audit your content to ask "what is the default culture?", you can be aware of what your content assumes and can then decide whether to reword or replace cultural references.

Step 2: Remove assumptions about shared cultural knowledge

It's fun to use cultural references when developing CS content, and it should be totally okay to bring in a cultural reference that's near and dear to you but may not be familiar to students from other cultures. However, when you do bring it in, be careful how you word it and be sure to provide any necessary context.

Consider these examples:

  • Magic 8-ball: I have a project on Khan Academy where students code a Magic 8-ball. I discovered that international learners struggled to complete the assignment, because they had never encountered a magic 8-ball toy. So I added an introductory sentence along with a graphic, and it was much easier for them.
  • Riffle shuffle: A 61A problem started with "The familiar riffle shuffle results in a deck of cards where…". Any sentence that starts with "the familiar" should raise flags, since familiarity is culturally dependent. I personally had never heard of it, and wasn't helped by the GIF that only showed the second half of the shuffle. I reworded to "A common way of shuffling cards is known as the riffle shuffle" and replaced the GIF with a video of the shuffle from start to finish.
  • Magic the Lambda-ing: This 61A problem assumed Magic experience in multiple ways, failing to explain how cards were drawn and using abbreviations like "stat" and "ATK". Generally, any non-course specific abbreviations should either be avoided or be explicitly defined. I revised the problem by adding clarifications, removing abbreviations, and adding a reference for students who wanted to learn more: "This game is inspired by the similarly named Magic: The Gathering."

Those were all fairly subtle rewords, but a subtle reword can turn a problem from one that alienates a student into one that introduces them to some new cool thing.

Step 3: Diversify the cultural references

If you have the means to authentically do so, you can now start to bring in more cultural references. A TA that loves cooking can bring in cooking examples, a TA that loves hair braiding can show how to make braids with loops. It's difficult and risky to bring in authentic cultural references from a culture that isn't experienced by any of the content creators. That's why it's important to have a diverse team, since each of your team members can make different cultural connections that might resonate with different students.

Here's a word cloud of interests from 61A students. Seeing the wide range of interests can inspire ideas for connecting content to student interests:

A word cloud of interests, like cooking, reading, video games, etc

One way to bring in culture that's relevant to your students is to get them to bring it in themselves!

  • In lectures, when live coding, you can ask students for examples, like "Okay, what are 5 song titles we can store in this array?"
  • In coding assignments, find ways for students to express themselves. For example, Khan Academy includes projects like drawing a dinner plate or making a recipes webpage, where students can show off their favorite foods. It is harder to evaluate the correctness and skill level of more open-ended projects, especially in massive courses. However, even if you can find small ways for students to customize their program output, it can increase their sense of ownership. (See this great research on creativity, customization, and ownership)

If your curriculum references historical figures (e.g. the inventor of an algorithm), they are very often white/male/European due to the bias of historical texts and a long history of patriarchy. See if you can find lesser known figures that also made contributions (a few examples here), or consider whether it's really necessary to emphasize the inventor (versus the invention).


Mirrors and windows

Another way to think about your content is to make sure it both offers mirrors (reflections of each student) and windows (views of other students), and gives equal weight to all the possible mirrors and windows.

Names. On Khan Academy, we use names in many word problems. To make sure we're not just picking the names that we personally know, we use a random name generator:

Three screenshots, two of word problems with names Hong Lien and Lakeisha, the third of a random name generator

Gender. Considering that gender is "a non-binary association of characteristics within the broad spectrum between masculinities and femininities," we should avoid encoding gender as binary in any content examples, like database tables, classes, or UI elements.

Consider instead a class like:


class Person() {

constructor(string name, []string gender, string pronoun) {
        this.name = name;
        this.gender = gender;
        this.pronoun = pronoun;
     }
}

new Person("Hunter", ["male"], "he");
new Person("Lee", ["female", "non-binary"], "they");
new Person("Emily", ["female"], "she");

Or a UI like:

A screenshot of a UI with a gender-picker that allows selection of multiple genders and offers a lot of possible genders

Pronouns.Similarly, refrain from relying on “he/him” as the default or assumed pronoun. Instead, be sure to use a natural, diverse selection of pronouns. I received bug reports for using "they" as the pronoun for a non-binary character in some AP CSP word problems on Khan Academy, but I kept "they" as I think/hope that people will become more accepting as their exposure to non-binary pronouns increases.

Sexual orientation. As discussed earlier, heterosexual is often the presumed default in our culture, but many people are homosexual, pansexual, asexual, etc. If you have content where it's appropriate to refer to people and their relationships, consider shining a light on the many kinds of relationships. We have a famous grammar problem on Khan Academy that brings in a ton of hate mail, but also brings in a lot of love mail from learners who have never before seen their relationships reflected in an educational website before! Here it is:

A fill-in-the blank problem with the sentence 'Brittany and Sofia went to lunch with their _ every Saturday' and options 'wifes' or 'wives'

Thursday, August 11, 2022

A browser-based runner for Faded Parsons Problems

A Parsons Problem is a kind of programming exercise where learners rearrange blocks of code in order to create functional programs, and has been shown by CS Ed researchers to be an effective way to learn code writing skills. One particularly helpful aspect is that students are re-creating an expert solution, versus writing sub-optimal or messy solutions, so they pick up better programming practices along the way. [See Barbara Ericson's dissertation for more details.]

However, one issue with Parsons Problems is that some learners may brute force the solution, trying all possible orders without thinking. Fortunately, UC Berkeley Ph.D. student Nate Weinman invented Faded Parsons Problems, a variant where the blocks sometimes have blanks in them, and learners must fill in the blanks after arranging the blocks. Learners are no longer able to brute force, but they still receive the other benefits of Parsons Problems. [See Weinman's CHI 2021 research paper for more details.]

While I was teaching CS61A at UC Berkeley, we experimented with integrating Faded Parsons Problems into our Python class assignments. To complete the problems, students ran a local Flask server on their own machine that sent data to our OKPy grading infrastructure. It seems to have been a positive addition to the course, though we discovered it was difficult for many students to run a local Flask server on their personal laptop. [A research paper is in the works with more details on what we learned.]

I wanted to try using Faded Parsons Problems in my upcoming Python course and to make it generally easier for any teacher to use them, so I've made a website that can run Faded Parsons Problems entirely in the browser (no backend). The website uses Pyodide to run the Python code and localStorage to remember learner progress.

The website checks the correctness of the learner's solution using Python doctests and displays pass/fail results. It also shows syntax errors, which can happen if they indent the blocks incorrectly or write something syntactically incorrect in the blanks.

The website is deployed on my Github pages currently, but it can be deployed on any static website hosting platform. If you're a Python teacher and would like to make up your own problems, you can learn more from the Github project README. Let me know if you end up using this in a class; I'd love to see your problems and hear how it goes.

If you teach a different language besides Python, it may be possible for you to get it working if there's a way to run that language in the browser. Forks or pull requests are welcome.

Sunday, July 10, 2022

Diversifying historical references in CS classes

 A few years ago, I discovered #DisruptTexts, a movement by teachers to challenge the traditional canon in English classes, i.e. spending less time on Shakespeare and more time on historically underrepresented authors.

I teach programming, not English lit, but I still wondered if there were opportunities in my curriculum to shift emphasis away from white male “authors” to people from other cultures. I realized that there are a few standard spots in programming courses that reference the inventor of some algorithm or concept, and that inventor is typically a white male. However, as a general rule, many "inventions" actually get invented by multiple people, and history books try to simplify it down to a single origin story. So, each time I found a reference to an inventor in my curriculum, I researched the web to find any additional inventors.


Here’s what I found for the topics I taught last year:


Fibonacci → Virahanka


When teaching iteration or recursion, I often show how to calculate the numeric sequence where each number is the sum of the two numbers before (1,1,2,3,5,8,13,…). 


The sequence is typically named after Fibonacci, an Italian mathematician from the middle ages who encountered it while modeling the reproduction of rabbits. 


Slide on Fibonacci's study of rabbit reproduction


As it turns out, a Sanskrit grammarian named Virahanka discovered the same sequence many centuries before, while modeling the syllabic structure of Sanskrit poetry. 


Slide on Virahanka's study of Sanskrit poetry


I love when programming and linguistics overlap, so i was fascinated to learn about Virahanka's sequence. To acknowledge the earlier discovery, I added slides on Virahanka and renamed the fib functions in CS61A to virfib.

def virfib(n):
  if n == 0:
    return 0
  if n == 1:
    return 1
  else:
    return virfib(n - 1) + virfib(n - 2)



Backus-Naur → Panini-Backus


Backus-Naur Form is a notation for describing the rules of a language’s grammar (as long as it is context-free). IBM engineer Peter Backus invented the notation in the 1950s to describe the grammar of Algol programming language:


Screenshot of section on syntax of for statements from ALGOL report

BNF is still used today to describe the grammar of modern programming languages. For example, the SQLite syntax reference uses railroad diagrams, a visualization of BNF grammar rules:


Screenshot of DELETE reference for SQLite



I was amazed to discover that this recent “invention” also has a much earlier origin story from the study of Sanskrit. Around 500 BCE, a grammarian named Panini used a formal notation to describe Sanskrit, and that system was very similar to what Backus created in the 50s. I won't share the Sanskrit rules since I don't read Sanskrit and can't be sure of what I'm sharing. However, here's a grammar diagram from a Sanskrit teacher:

Grammar diagram for Sanskrit

As you can see, the construction of a word in Sanskrit follows similar flows as the construction of a DELETE statement in SQLite. There are elements that can be repeated, elements that must be at the beginning or the end,  recursive elements, etc. Those are the sorts of requirements that could be described both by Panini's 500 BCE notation or by Backus' 1950s' notation. 

For that reason, some propose renaming BNF to Panini-Backus form. I did not end up doing that when I taught BNF, since we were also teaching EBNF and I wasn’t prepared to also rename that. However, I do mention its much earlier invention in India when lecturing in class.


George *and* Mary Boole


One of the most foundational concepts in programming is logic, the way we can combine true/false expressions using AND/OR/NOT/etc, and yield a true/false result. That’s called Boolean logic, named after the English logician George Boole who described the system in the 1854 book, The Laws of Thought.


George Boole was married to another mathematician, Mary Everest, who also wrote books on math, despite living at a time when women weren’t welcomed in academics. Mary is known to have contributed heavily to the editing of George’s book and was a loud proponent of its ideas after George’s early death. I am certain that many inventions of married men throughout history were helped significantly by their significant others but not attributed to them. How many women and non-binary inventors would we know about today if history wasn't so rife with patriarchal systems?


Fortunately, we know about Mary’s contributions. Heres how I describe it in my co:rise Python course:


Booleans are named after George Boole, a self-taught logician. He described a system of logic in an 1854 book, The Laws of Thought, that was edited by his wife Mary Everest Boole, another self-taught logician. According to Mary, George was inspired by Indian logic systems dating back to 500 BCE. We can actually find the origins of many "modern" computer science concepts in ancient systems of India, Africa, or the Mediterranean.


And look, another reference to Indian scholars from thousands of years ago! It makes me wonder how many times logic was independently invented across the world.


Those are the places I found so far where I could diversify the historical mentions. Unfortunately, most inventors are still male and from the upper class of society, since we history rarely hear from oppressed genders and classes. 


I’d love to know if other CS teachers have discovered ways to #DisruptTexts in your CS classrooms. 

Monday, July 4, 2022

How to audit CS61A

I taught/co-taught CS61A at UC Berkeley for the last three semesters. Since it is a fairly well known class, I often get asked how to audit the class, both by Berkeley students and people outside of Berkeley.

Generally, CS61A materials are accessible online, so you don’t need special permission to audit the class. Here are some tips I often give, however.


If you are happy to follow the pace of the current semester (i.e. summer/winter/fall), then use the materials at cs61a.org. You will need to wait for assignments to be released, and you can see those release dates on the front page calendar. 




Otherwise, if you want to be able to blaze through the materials at your own pace, you can access previous semesters by navigating to <semester><year>.cs61a.org, where <semester> is either “su”, “fa”, or “sp”, and <year> is the last two digits of the year. For example, sp22.cs61a.org is the spring 2022 semester when I solo taught, and fa21.cs61a.org is the fall 2021 semester when I co-taught with John Denero. Each semester differs slightly in terms of content and instructor. Denero is the most common instructor and the one who originally created the Python version of the course (CS61A was originally taught 100% in Scheme).


All the assignments (labs/homeworks/projects) are autograded using a system called OKPy that checks whether your code passes the tests. By default, the OKPy command asks you to login to a Berkeley account for backup/submission purposes, but you can bypass that check by adding `-- local` to the command. That allows you to check all your work locally regardless of whether you're a Berkeley student or not. 


The official solutions for the assignments are only available during the current semester, released ~3 days after assignments are due, but are taken down once the semester is over. So, if you think you'd benefit from seeing the official solutions, you should follow along with the current semester instead of going through a previous semester's materials.


Lecture slides are linked from the front page calendar. The lectures themselves are either over Zoom or in-person, depending on the semester. If you're in the Berkeley area, you actually can stop by the lectures in-person. However, if you're not a Berkeley student, you typically cannot access the lecture recordings, as they are uploaded to services that require a Berkeley account. We have to keep the recordings internal for legal reasons, as the recordings are not properly closed captioned, and any published recordings from a university must be closed captioned. 


However, John Denero has a set of pre-recorded lectures that are closed captioned and available on YouTube. Those lectures are often linked from cs61a.org in some way. For fa21.cs61a.org, follow the "Playlist" link under each lecture title. For sp22.cs61a.org, click the lecture title and watch the embedded player. For summer 2022, click "Precorded" under each lecture title. When Denero is one of the lecturers of the semester, his videos are often fairly well aligned with the official lectures. However, when he's not one of the lecturers, there will be some divergence in the content, and sometimes there will be no Denero lectures available for a particular topic.


The textbook was written by Denero and is available for free online at composingprograms.com. The front page calendar has a column which lists which textbook sections are relevant to that lecture. Once again, the textbook readings will be the most aligned in a Denero-taught semester and may be divergent/missing for some topics in non-Denero semesters. 


Typically, the lectures cover similar content as the textbook, so you could decide to only read the textbook or only watch the lectures, and not really be missing anything. When I went through the materials, I primarily read the textbook and only watched videos when I felt like I wasn't really grasping something and wanted another explanation.


Hope that helps!


Sunday, May 22, 2022

My experience as a Unit-18 Berkeley Lecturer

From spring 2021 through spring 2022, I was a Unit-18 Lecturer for UC Berkeley in the EECS department. A Unit-18 lecturer is what is often called "adjunct"; it's not on a tenure track, isn't part of the "Academic Senate", and it's represented by a union. Since I don't have a PhD, I am not eligible for tenure-track lecturer roles at UC Berkeley.

Here's a high level overview of my 1.5 years at Cal, both in terms of courseload and "lifeload":



I include my lifeload above as I imagine my experience may have been different if I didn't have a young child to support financially and to care for in the evenings/weekends.


Here are my reflections on the various aspects of being a Unit-18 lecturer. I am grateful for the experience, as I've learned a lot, but alas, there were more negatives than positives in the end. I will be going back to industry, but perhaps one day will return to academia when it's a better fit.


Compensation: Too Low


My salary as a Unit-18 lecturer with a 100% appointment was about 100K annual compensation until our union's strike and new contract brought it to be about 107K. That compensation is technically for 9 months (since we "only work 9 months") but spread over 12 months.


That is the lowest salary I've had in quite a few years, especially since there is certainly work to be done over the summer/winter. There are also quite a few expenses to this job that I haven't had in tech jobs: parking fees ($118/month), meals ($15/day), A/V equipment for at-home Zoom instruction and in-campus hybrid instruction, snacks for staff events, etc. It's possible to ask for reimbursement for some of the latter costs, but I've had mixed success and have mostly stopped asking.


For comparison, if I were to take a software engineering job right now, I would earn a minimum of 160K (like at a startup with high equity) but more like 220K+. Plus sign-on bonus ($20-120K), stock options, annual performance bonus (10-40%), etc.


Courseload: Too High


Sp21: I actually found the courseload of my first semester at Berkeley quite reasonable. I co-taught CS61A along with Paul Hilfinger and co-taught CS302 with Dan Garcia. I had fortunately spent the month before starting at Berkeley going through the entire CS61A materials, so I felt prepared topic-wise. Hilfinger wanted to teach most of the lectures, so I instead focused my time on exam writing and other course improvements. That semester was also entirely over Zoom, which meant no commute time plus more compatibility with taking care of a 1.5 year old in the evenings. I was even able to attend staff meetings with my daughter napping on me.


Fa21: That semester was brutal. I co-taught CS61A with John Denero and CS169A with Michael Ball. This time, I gave all the 61A lectures, so I had quite a lot of lecture prep to do, ~6 hours per lecture. Fortunately, John wrote the exams so that was off my plate. I found it really difficult to balance CS61A (a massive class of 2000) with CS169A (still a fairly large class of 350), since 169A required a fair bit of work in writing quizzes/exams (5 quizzes, 1 exam), grading open-ended homework assignments, and staff management. I was also new to CS169A, so I was trying to go through the assignments before giving them to students, and that takes a lot of time.


On top of it all, I was also in my first trimester of pregnancy, experiencing the most fatigue and nausea I've ever had in my life, so it was difficult to force myself to stay up late to get everything done.


Sp22: Somehow still a pretty rough semester. I solo taught CS61A, co-taught CS169L (30 students) and co taught CS302 (30 students). I fortunately had the majority of my lectures prepped for CS61A, but I was admittedly eager to try out some course changes, especially since we'd received funding for a particular change that we'd been working on since the summer. Implementing changes in a course significantly increases the time required for new lectures, new assignments, TA training, support, etc. I found it hard to balance CS61A with CS169L and CS302, plus all the random other committees and commitments I'd picked up in the last year, especially on days where all of them suddenly had urgent things that needed doing. There were many nights where I thought to myself "I don't know how everything's going to get done by tomorrow, but somehow it will, please please I hope."


Generally, I think the workload formulas at UC Berkeley don't account for the many aspects of running a course. They consider the time required for lecture and office hours, but that is such a small aspect of everything involved. Many hours are required for staff management (given how large they can be!) and dealing with the increased number of edge cases that occur with large number of students (academic misconduct, Incompletes, extensions, incidents, etc). I think that teaching a massive course like CS61A, with perhaps 1 small course like CS302, should count as a 100% appointment. Otherwise, when faculty members are forced to take on too many courses, we often have to skimp on aspects, such as staff management or assignment refinement, and that skimping can have significant negative effects.



But You Get Winter/Summer Off!


Hahaha, no.


First of all, there is actually work that needs to be done during the summer. CS61A needs to hire 100 staff members for each fall semester, and it takes a long time to go through all the applications and determine which 100 people to hire, conduct interviews, contact references, etc. In theory, we were supposed to finish hiring by early June, but it just wasn't possible to hire that many people so quickly. 


Besides hiring, there's also preparatory work to do for the next semester, like if you're teaching a new course, since there's often no time allocated for that during the semester.


There's also grading that happens in the winter. Sadly, for CS169A, grading took so much time that we had to request an extension and then we stayed up til 1am on New Years Eve calculating the final grades and submitting them. Happy New Years! Resolution: Never do that again! 


But the real issue with the summer/winters is that my compensation as a Unit-18 lecturer was so low that I could not afford to not work at all during them. My bank account actually nearly went to $0 last summer, which hadn't happened to me since… college? I ended up taking on various curriculum/teaching gigs during the summer which paid some, but the payment came months later. I perhaps should have taken on software engineering consulting instead, which likely would have paid higher and sooner.


In the winter, I developed an online course for a company that would pay me based on the number of students that took the course each offering. The first cohort turned out to be small, so that didn't work out great for this year, but future cohorts may be larger, so the time investment may eventually be worth it.


If I was earning a higher base salary, then I perhaps could fully relax during the summer, as is rumored to be possible as a professor, but Unit-18 salaries put that dream farther out of reach.


Also, notably: I really couldn't take any vacation at all during the fall/spring semesters, whereas I could take a vacation every few months if I worked in tech. So I'm not sure how much it's really worth it if you have to go so hard for 9 months with no breaks in order to get those few months off. I think I'd prefer more breaks scattered throughout the year.


*Yes, there's a spring break, but I had to use that to prep lectures for the rest of the semester, due to a lot of overlapping deadlines in the post-spring-break weeks.


Benefits?: Health Insurance


My first lecturer appointment was only for a single semester (which may be standard practice?), and it meant I was only eligible for catastrophic insurance during that time. The HR officer advised me to get other insurance if I could, but my COBRA would have been $1500 per month, and I’m not married to my partner, so I stuck with the catastrophic insurance and just tried very hard to not get sick/injured. 


Unfortunately, I did have a medical issue at the very end of those 6 months, and ended up in a limbo for a few weeks between catastrophic insurance ending and comprehensive insurance kicking in, and I just constantly called an emergency nurse line for reassurance that I wasn’t dying. Finally, Kaiser kicked in and I was able to recover.


The Kaiser insurance plan is similar to what I've had in the past at tech companies, which I think is a good level of health insurance. I would have just appreciated it earlier :)


Benefits?: Maternity Leave


The maternity leave benefits for Unit-18 lecturers are not great. When I had my first baby while working in the tech industry, I got 4 months fully paid leave, no questions asked. At Berkeley, when I realized I was pregnant with a second baby due June 3rd, I had to do a lot of asking around to see how much leave I would be eligible for. I think it turned out to be  around 10 weeks, but since it would have been during the summer months anyway (during which Unit-18 lecturers receive payment already), HR suggested not going through the effort to formally go on leave. 


I also discovered I was eligible for "Active Service Modified Duty", which meant I could request a modification to my typical lecturing duties in the fall semester, as long as the department approved. I ended up requesting a semester where my only course would be solo instruction of 61A, but I would also do preparatory work for next semester's first time teaching CS160, plus writing the spring 61A exams and working on a few new 61A projects. Such a semester certainly would have been a lower workload than a semester teaching 3 courses, so I appreciate the chairs for approving it, but would still have been rough to balance with having a nursing 3 month old. 


Okay, But Teaching Is Fun?!


There are indeed many aspects of teaching that are very interesting intellectually and quite fun. What I love:


  • Lecturing. I like trying to figure out how to present something in a way that makes sense. Granted, I don't always succeed, but it's interesting to see when an attempt fails, too. I also love the questions that students ask, since it prompts me to learn something more deeply.

  • Assignments. Similarly, it's interesting to figure out assignments that will help students learn a particular topic. TAs often do a lot of assignment creation, at least in 61A, but I like working with them on that.

  • Autonomy. Probably the greatest park of academia is that we do get a fair bit of free rein as lecturers. If I want to experiment with a slightly different topic ordering or even a new topic, then I don't need to request permission from anyone above me. I do need to get staff on board and make sure they're comfortable with it, since they'll need to teach that in their sections, but that feels very different from the top-down decision making that often happens in tech.


However, there are also aspects of university teaching that are not that fun (to me), such as:


  • Academic Misconduct. I'm so sad when we discover students cheat. But we do need to look out for cheating, since it's unfair to students that aren't cheating if other students are freely allowed to cheat. 

  • Grading. Unfortunately, grades really do mean a lot at Berkeley, especially for CS61A, since L&S students must get a 3.3 average GPA in 61A/61B/70 in order to declare CS. Even a few points out of 300 can make a difference to someone's final grade and thus their ability to declare, so we get a lot of regrade requests throughout the semester. I've had some 20-email-long threads entirely about just 2 points. I totally get why students care about 2 points, since there's that dang GPA cap, but I still find it exhausting to reason about why one student should get 2 points and not another student. My best approach has to just been as consistent as possible, which often means erring on the side of being less generous.

  • Staff management. It's hard. I've done people management at various times in my life, but it's difficult to do it well while also trying to do many other aspects of teaching. I don't think I've done it particularly well in my time here. Part of that is never having managed undergraduate TAs, part of that is lack of time in being able to do mentoring, check-ins, etc. 

  • Service. There's this thing in academia called "service" referring to things like serving on committees. I believe it's viewed favorably for tenure-track faculty members when tenure is being decided, but for Unit-18 lectures, it mostly feels like unpaid labor. Some of the committees do discuss interesting topics and make important decisions, but I think Unit-18 lecturers should be paid more if that is going to be a part of our job, since we already have higher teaching loads than normal faculty.

  • Faculty Hierarchy. Unit-18 lecturers are very low down on the totem pole in terms of the classes of faculty members at the university. My first semester, I wasn't allowed on any of the faculty mailing lists. I'm still only a few of them, and I'll hear every so often about discussions that happen on the "real" faculty lists. There are also some faculty meetings we aren't allowed to join, like particular hiring discussions. It's not even that I want to be involved with all of these things; but it does start to feel bad when you realize increasingly how much you're excuded from.


I want to thank those at Berkeley who helped me get the lecturer position, as I've always been very eager to try out university lecturing. I hope that one day I may return as a lecturer at Berkeley or elsewhere, once it's a better fit for my financial and caretaking needs. In the meantime, I've decided to share my experience for others who are considering pursuing the same or similar roles.


Wednesday, January 26, 2022

New online class: Python Crash Course on Co:rise

I've always been excited by the possibility of online education. Years ago, I was an early engineer at Coursera helping university professors make their courses available in a MOOC form. I then joined Khan Academy to put my own courses online, putting together computer programming courses in JS, HTML/CSS, and SQL. 

The Coursera and Khan Academy courses are similar in that the content is largely self-paced, and you don't often have a strong sense of being in a class with classmates. That's okay for many learners, but there are also quite a few learners who like the feeling of a community and the social accountability of a cohort. 

Co:rise is a new platform for online learning that's attempting to offer the best of both worlds: easily accessible online content (articles, quizzes, projects) plus live weekly sessions (with instructors, TAs, and guest speakers). I'm really intrigued by the combination and its potential for better online learning, so when they asked me to put together a course for it, I immediately signed up.

I spent winter break putting together Python Crash Course, a 4-week course with about 6-10 hours of work per week. It's an introductory course, targeted at folks new to programming or just new to Python. Each Monday will start off with a Zoom lecture with me, where I'll lightly introduce the week's topics. Then you'll dive into the articles and coding challenges from Monday-Wednesday. We'll have another Zoom session on Thursdays to kick off the weekly project that uses all the skills you've been practicing in the challenges. Our TAs will have office hours Friday and Saturday to help with project questions, as well as answering them in our class Slack.

Here's an example early coding challenge from the functions topic:



And here's an example of what you'll do in one of the projects - write code to invert the pixels in a photo:
 ⇨ 

I'm very excited to try out this model of online learning, and would love help in spreading awareness of the first cohort of the class, starting March 21st. The whole 4-week class costs $400, which seems like a reasonable price point based on similar offerings. As much as I'd love for all education to be free, charging is necessary for us to be able to offer the live sessions and TA help. For a 5% discount, use code PAMELA10PY.

We hope to offer the class 3-4 times per year, if there's enough interest, so stay tuned to corise.com for future offerings. If you're already an experienced Python programmer, check out their many other classes in Python/ML topics, like NLP and MLOps. 

Tuesday, December 15, 2020

The harms of assuming cultural knowledge in coding assignments

I love using computers to re-create real world objects, like coding a simulation of a plant growing or making a 3d animation of a lava lamp. I can rarely capture the beautiful complexity of a non-digital object, but I sure can have a good time trying! So when I come up with assignments for programming courses, many of them ask learners to program a simplified version of some IRL object, game, or situation. My hope is that the programming assignment is more interesting to learners because of its connection with the world around them.

For example, in the Khan Academy Intro to JS course, one of the projects asks learners to create a Magic 8-Ball to practice their understanding of randomness and conditionals. I have fond memories of Magic 8-balls from my youth, asking them seemingly very important questions and shaking them to gain insight into the machinations of the universe.

But then I got feedback that many learners had no idea what a Magic 8-ball was. That’s when it dawned on me: those toys were popular in my youth in upstate New York, but they never became popular in most non-US countries, and they’re not particularly popular these days even in the US.

So I was asking learners to re-create something they had never seen, and I wasn’t even explaining very well what it was! So I quickly modified the project to start off with a description of the toy and that reduced the number of confused help requests from learners.

Ideally, I would even replace the project with one that felt culturally relevant to more people. However, it is hard to come up with projects that are culturally relevant to everyone, since we all come from so many different cultures.

In a course that serves a global audience, one approach is to always offer a variety of projects, allowing learners to work on the project that most appeals to them. Our Hour of Drawing with Code on Khan Academy ends with three different projects- creating a wild animal, a super snowman, or a self-portrait. When I analyzed the data a few years ago, I found that learners were roughly equally picking each of the projects, so I’ve left all the projects in instead of trying to force the most popular project on everyone.

Another risk of culturally dependent assignments is that they can cause a learner to question whether they belong. For example, I’m currently working my way through a programming course where the biggest project is a violent tower defense game. I do find it fun to make some kinds of games, but I hated working on that project as it reminded me of my least favorite use of coding and made me wonder if I was the only one that wasn’t into implementing death matches in code. Fortunately, I’ve been in coding long enough to know that indeed, programming is used for many non-violent applications as well.

But if that was my very first intro to programming, I would have many questions as to what industry I was entering and whether I would find folks with similar hobbies and values as me.

So when I create new assignments in the future, these are my goals:
  • If I reference a particular cultural object, I will not assume the learner has prior experience with the object and will provide background knowledge. For example, if an assignment asks learners to implement a game of Poker, I would need to fully explain the rules of Poker. A programming assignment already requires the cognitive load of the programming techniques; it shouldn’t also require the cognitive load of understanding someone else’s culture.
  • The assignments should reflect the varied cultures of the learners as much as possible. It follows from that goal that I need to learn about the cultures of the learners (as they may be increasingly different from me, as I get older) and that the assignments are subject to change over time (as cultures change).
  • If an assignment relies heavily on a particular cultural interest, such as card games or Disney movies, there should be an alternate assignment available as well. If one set of learners gets to program something that’s highly interesting to them, then the remaining learners should have that opportunity as well.

Those are my current thoughts. I’d love to hear yours!

Tuesday, June 19, 2018

My spring in a high school CS classroom

(This is cross-posted from Medium, where it's better formatted)

Computer Science isn’t yet a requirement at the K-12 level, but fortunately, there are a growing number of CS classrooms across the US. Many of those CS classes are taught by teachers that are relatively new to CS, like former math or science teachers, so they have a lot to learn quickly.
That’s where the TEALS program comes in: its a program that matches teachers up with volunteers from the software engineering industry. In the co-teaching model, the volunteers actually teach much of the first year (with the goal of serving as an example for the teacher for the next year). In the TA model, volunteers help students with their questions and debugging.
For those who don’t know me: I’m a software engineer half the time and a teacher the other half. I created all the programming courses for Khan Academy, and most of those were based on in-person workshops for GirlDevelopIt SF. I recently took a break from teaching to do the startup thing, and when I got over the startup thing, I realized how much I missed being in a classroom, so I signed up to be a TEALS volunteer.

The AP CS A Class

I got matched up with Berkeley High School’s AP CS A, a class which uses Java to teach programming concepts, particularly of the object-oriented variety. My very first language was Java (back when Applets were cool), but I hadn’t done any in years, so I binge coded CodingBat problems to prep.
I showed up, and discovered the class was basically as a 100% lab class. The teacher assigned Runestone chapters and CodingBat problems on Google Classroom, and the students worked independently through them, asking for help or helping each other when needed.
I’d walk around with my mini whiteboards, ready to diagram a coding problem at a moment’s notice. I found that always having a whiteboard on hand made me much more likely to guide the student to the answer than just provide the answer immediately.
Helping the students was very fun, and I liked getting deeper into the intricacies of Java. However, I’m a very project-oriented person when it comes to coding, so I was eager to introduce these students to projects: longer assignments with less structure and more creative coding. Thankfully, the teacher welcomed my ideas and was happy to try them out.
We started with a simple Valentine’s Day project, ASCII Candy Hearts —as it turns out, that was their first introduction to ASCII art, and it quickly became a mainstay in every project after that. ♥♥♥
Then we introduced Pair Programming starting with the WordGuesser Game project, and the energy of the room shot up. It was so fun seeing them working together and checking out their takes on each project.


Bringing in chocolate bars for each pair sure motivated them on the ChocolateBar project…🍫

We still needed to prep the students for the AP exam, so we spent the month before the exam on more individual work, like paper programming and multiple choice exams. Ok, and we squeezed in some Binary Bingo…



After the AP, we spent the final month learning the Processing library, and everyone went to work on making visualizations and games. It was a great way for them to use all the Java concepts they’d learnt (like classes for game objects, arrays and ArrayLists of multiple objects, conditionals for collision detection), while also producing a really fun output.



In case it’s useful to anyone else teaching or helping out in an AP CS A class, I’ve written up our sequence of materials in this document.

Intro to Programming

Many CS teachers teach more than one CS course. That means that not only do those teachers need to learn programming, they often need to learn programming in multiple environments and languages, plus CS concepts like algorithms and logic. That’s part of why the TEALS program is so needed — there’s just so much to learn in CS land, let’s give teachers a helping hand!
At Berkeley High School, I soon found out that the teacher taught two sections of an “Intro to Programming” class right after the AP CS A class. Those students started off in Python and Turtle Graphics for the first half of the year, following the Runestone tutorials. Then around the time I started volunteering, it was time for them to switch over to HTML/CSS, and what do you know, their teacher decided to assign them my Khan Academy course.
Of course, I started volunteering in the Intro classes as well. I wasn’t doing the job thing at the time, so I couldn’t resist helping out a classroom of budding web developers. 😄
Once the students learned JavaScript, we started on projects like TicTacToe and MadLibs. We quickly discovered these students weren’t as into pairing as the AP class, likely due to being younger/shyer and not feeling as comfortable with each other. BHS is a high school of 3100 students, aggregated from multiple middle schools, so sadly, many of them just don’t know each other.
As I was helping the students, I noticed they were frequently distracting themselves on GeoGuessr.com, a game where you see a random streetview and have to guess where it is in the world. I became determined to prove to them that they too could build GeoGuessr. Five projects later, they’d learnt about iframes, query parameters, APIs, and geocoding, and they all made their very own GeoGuesser game.



Now what if they shared their GeoGuesser project with friends and wondered how well how they scored? They wouldn’t be able to see that yet, because they didn’t know about databases yet. To me, the magical part of the web is being able to see how people all over the world can use what you’ve made, which means you need to store their data somehow. So I showed them AJAX, SQL, and a simple Express+SQLite server. There wasn’t enough time for them to deeply understand Node, but I could at least put the idea in their head, and a number of them used Node to store results for their final.
Students made a big range of final projects, like games in Canvas/Processing, charts using Plotly/CanvasJS, personality quizzes, Jeopardy games, encryption puzzles, and custom maps of fantasy worlds. My favorite was Flickr Feud, a game that pulls random photos from Flickr, asks Watson to identify them, and scores based on your ability to guess what Watson said.



If any of you are teaching a web development class and are looking for more project ideas, I’ve written up the Intro materials in this document.

Reflections on the high school classroom

In the past, my classroom teaching experience was mostly workshops, where the attendees were very eager to be there and to learn. That’s not always the case with high school students — sure, CS classes are electives, so they did choose to be in them at some point, but they’re also busy with other classes and just growing up. And hey, maybe they’re not as into CS as they thought they’d be, or maybe their parents picked their electives.
The point is: high school students aren’t always that into you (me), and not always that into what I’m teaching or how I’m teaching it. That can feel like a downer, but it’s also refreshingly humbling. I tried teaching with a slide deck once, looked out upon a sea of bored faces, and from then on, I only taught via whiteboarding and live coding, and no more than 15 minutes of that.
I feel like I improved my teaching skills thanks to the honesty of high schoolers, so I am thankful for that. 🙏

Thinking of being a CS classroom volunteer?

I’m hoping that a few of you reading this post are software engineers and considering volunteering in a local classroom. I went every day and came up with project ideas, because I had the luxury of being funemployed at the time.
However, TEALS volunteers can come in as little as 1–2 days a week and simply be a TA and answer student’s questions about the tech industry. Plus, TEALS partner schools often schedule the classes as the first period of the day, so that you can wake up, volunteer, and still get to work on time.
You can learn much more on the TEALS website here: https://www.tealsk12.org/volunteers/
Another way to volunteer in classrooms is to email the local schools, like if you’re keen to help out in a middle school or elementary school. I spent every Thursday afternoon this spring at the local middle school coding club, helping with SCRATCH and WoofJS, and I found that opportunity by emailing the local school system.
Classrooms are fascinating. If you have the time, go find one and see! 😊