by Jan Cash

When I read articles on why there are so few women working as programmers, they often focus on the concept of a leaky pipeline. Girls are interested in computer science early in their education, but ‘leak’ from the tech career pipeline as they’re pursuing their degree or building their careers. Technically, I’m one of the ones that leaked.

While I was growing up, I loved math and programming, but by the time I got into college, I made a conscious decision to major in neither. Now, I work in publishing—a field dominated by women.

My interest in programming was initially social. When I started programming in middle school, I’d go to math club right after class, then go home to spend hours building small websites on Neopets. In the 90s, Neopets was a popular kids’ website centered on raising pets and would give users customizable pet webpages. Many users would re-dedicate pet pages by coding them into personal websites using HTML and CSS. My world was filled with fan shrines, glitter gifs, and pixel art, but it all happened outside of school.

I got started by checking out a tome on HTML from the library and working through it chapter by chapter to make tiny webpages for every concept I learned. Back then, I still liked math, so I might have made something that looked like this:



<b>The Fibonacci Sequence</b>

0, 1, 1, 2, 3, 5, 8, 13, 21


My middle school self would have packed this page with color-changing links, custom scrollbars, and animated pixel art, but this code simply makes an HTML page with a pink background and some text.

When run in a browser, it would display the Fibonacci sequence like this:

The Fibonacci Sequence

The more I learned, the more I wanted to know. I spent a lot of time looking at the source code from other people’s sites. Some of them would be similar to mine with just a bit of HTML, but others would have JavaScript elements that I didn’t understand. I’d play with the scripts and try manipulating them for myself, but most of the code was beyond me.

I wanted to learn more, so my parents helped me sign up for an introductory programming class at the local junior college. When I went into the class, I was the only middle school student and the only girl. The rest of the class and the instructor were all adult men. My experience was mixed.

The other students in the class were there for the same reasons I was—they were curious or wanted to create things—but I still stuck out. For the first few weeks, I had the unshakable sense that I didn’t belong. I was an intruder who happened to find my way into their classroom, and I felt like I needed to prove myself to stay.

Because I felt I needed to work harder than the others in the class, I made a lot of mistakes in my programs. I was told good programmers use comments to make reading their programs easier, but I needed to be a great programmer, so comments were a shortcoming. If I was good enough, I believed, I’d be able to tell what my code did immediately just by reading it.

My first few assignments looked terrible. If I’d written code in Python to print the Fibonacci sequence, it would look something like this:

num = 0
print(num, end=", ")
numNext = 1
print(numNext, end=", ")
numHolder = num
num = numNext
numNext = numHolder + numNext➊
print(numNext, end=", ")
numHolder = num
num = numNext
numNext = numHolder + numNext
print(numNext, end=", ")
numHolder = num
num = numNext
numNext = numHolder + numNext
print(numNext, end=", ")
numHolder = num
num = numNext
numNext = numHolder + numNext
print(numNext, end=", ")
numHolder = num
num = numNext
numNext = numHolder + numNext
print(numNext)

This code calculates and prints each number of the Fibonacci sequence individually up to the number 8. It holds three numbers of the Fibonacci sequence at a time in the variables num, numNext, and numHolder, and adds together the last two calculated numbers to produce the next number in the sequence like at line ➊, and then prints the newest number to the console.

The program’s output looks like this:

0, 1, 1, 2, 3, 5, 8

Eventually, I learned how to use other programming concepts and started adding comments to my code, but my doubts about belonging remained. I could make more complex programs, like this:

#This code prints the Fibonacci numbers starting from 0 up to 13
#Create a list
num = []➊

#Start at base case 0
num.append(0)

#Add 1 to the base case and assign to next index in list
num.append(num[0] + 1)

#Starting at index 0, add the index's value
#And the value at the next index
#Up to index n
n = 6➋

for i in range(n):➌
  num.append(num[i+1] + num[i])

#Print the Fibonacci numbers
print(num)

This program stores all the numbers of the Fibonacci sequence in a list ➊ as it calculates them using a for loop ➌. The variable n at ➋ determines the number of times the for loop runs and i is incremented at each iteration and used to access the indices of the list to add the list’s last two values together.

The program’s output looks like this:

[0, 1, 1, 2, 3, 5, 8, 13]

Although I was learning new concepts and making small programs to solve math problems for fun, the class’ assignments weren’t the types of programs I wanted to create for myself. I didn’t see a point to continue in something where I couldn’t see myself as an adult.

After the class was over, I stopped programming.

During the rest of middle school and high school, most of my focus went into math. There were rarely other girls in the school’s math club, but I was also enrolled in a girls-only math program tutored and run exclusively by women and, whenever I was in a math competition, there was always at least one other girl.

Although math never had the same social aspect for me as the online programming community, I was constantly seeing women who had successfully pursued it. Nearly all my math teachers had been women, while the programmers I met had been men. I was convinced math was going to get me into college, not my pink websites. But the more I dedicated myself to math, the more I felt boxed in, and the more I resented it. When I started college, I avoided programming and math classes altogether and instead majored in biology.

The next time I encountered programming was unexpected. We were covering a unit on flocking patterns in my animal behavior class, showing how birds form intricate patterns while flying as a group. Then we looked at computer simulations that recreated these patterns using NetLogo, which is a programming language and interface made for visualizations that instruct little programmatic creatures called turtles to move around the screen and perform tasks.

In NetLogo, you could create and control hundreds of turtles at a time with code. We started off by making the turtles move and creating tiny ecosystem models. We only spent a week on the module, but by then my love for programming had rekindled. I spent my spring break making my own flocking programs and seeing what I could do.

Python has its own turtle library, and with it I can make a visualization of the Fibonacci sequence, like this:

#This code prints the Fibonacci numbers starting from 0
#And uses the turtle module to visualize the sequence
import turtle➊

#Create a list
num = []

#Start at base case 0
num.append(0)

#Add 1 to the base case and assign to next index in list
num.append(num[0] + 1)

#Starting at index 0, add the index's value
#And the value at the next index
#Up to index n
n = 12
for i in range(n):
  #Add the last two numbers together
  #And append the new number to the list
  num.append(num[i+1] + num[i])
  #Move the turtle forward
  turtle.forward(num[-1])➋
  #Turn turtle 90 degrees to the right
  turtle.right(90)➌

#Print the Fibonacci numbers
print(num)

For this I reused my code, but imported Python’s turtle module ➊ and added two lines of code to the for loop. The first line ➋ has the turtle (which looks like a tiny triangle) move forward the same number of units as the last number generated in the Fibonacci sequence and the second line of code ➌ turns the turtle 90 degrees to the right. The turtle does this for every number calculated in the sequence, which makes the turtle move in an angled spiral around the screen, like this:

Fibonacci spiral

I tried making a cicada simulation for my final project in the animal behavior class to see how prime numbered mating cycles prevented the wrong species of cicada from mating with each other, but NetLogo wasn’t powerful enough and couldn’t handle simulating thousands of turtles at a time. I wanted to do more, so I signed up for an introductory programming class.

Princeton had two introductory classes when it came to programming. The first was unofficially nicknamed “emails for females.” It was designed for humanities students interested in technology who had never programmed before, but covered computer internals, programming with JavaScript, and even basic cryptography. It was taught by the Brian Kernighan of Kernighan and Richie’s C book, but that didn’t matter. The course was still the lower level introduction, so it was “for females.”

The other course was also for new programmers, but covered concepts specific to people interested in pursuing computer science. This was the course I took.

In the course, I learned about recursion, which is when a function calls on itself. This is what the turtle program looks like with recursion:

#This code prints the Fibonacci sequence starting from 0
#And uses the turtle module to visualize the sequence
import turtle

#Create a list
num=[]

#Calculates the first x numbers of the Fibonacci sequence
def fib(x):➊
  if x == 0: #Return when done
  return
  if len(num) == 0:❷
    #Start at base case 0
    num.append(0)
  elif len(num) == 1:➌
    #Add 1 to the base case and assign to next index
    num.append(num[0] + 1)
  else:
    #Add the last two numbers together
    #And append the new number to the list
    num.append(num[-1]+num[-2])
    #Move the turtle forward
    turtle.forward(num[-1])
    #Turn turtle 90 degree angle to the right
    turtle.right(90)
    return fib(x-1)➍
    #Calculate next number in sequence

#Create the list of numbers
fib(14)

#Print the Fibonacci numbers
print(num)

This program packs all of the code used to generate the Fibonacci sequence into one function called fib() ➊, which takes the number of Fibonacci numbers to generate as an argument. When the function is first called, it appends the base case of 0 to the list using an if statement ➋. Then the function calls on itself and passes the original argument passed to it decremented by one ➍. When the function is called a second time, it should append a 1 to the list because of the elif statement ➌, then call itself again. Each time the function calls itself, the argument will be one smaller than the last call, essentially acting as a countdown to 0. While the argument passed to the function isn’t 0, it will calculate the next number of the sequence and draw with the turtle. When the argument value passed to the function reaches 0, the function will return and stop recursing.

By the time I started my class, I regretted not pursuing programming earlier. I was a junior and it was too late to add programming as a minor. I gave up again to focus on my senior thesis and getting a job out of college.

Eventually, I came to my current job as an editor working on programming books. Even though I use all the technical skills I learned from my programming classes in my job and have to understand how all the code in the books work, I’d probably still be considered another leak in the broken pipeline.

But the pipeline metaphor itself is broken. A pipeline assumes that there’s only one starting point and one destination, but the people who leave the pipe actually create resources that nurture others to grow.

Most of my job is about helping authors teach others. I work on titles aimed at experienced programmers, but also kids’ titles that will help the next generation of coders start out on their own projects and explore their interests like I had.

While exploring the tech landscape and looking for new authors, I’ve found that the women programmers who I hadn’t seen while I was growing up are finally visible to me. We now have initiatives like Girls Who Code and local PyLadies meetups whose sole purpose is to support girls and women in addition to entire conferences dedicated to marginalized groups like Write/Speak/Code and AlterConf.

Diversity among programmers increases diversity in the ways programming is used. For example, the divide between the technical and artistic is coming down. We have technical zines and educational art created by programmer artists like Amy Wibobo, Julia Evans, and Mariko Kosoka who teach code through their drawings. Although women are not the only ones creating educational art, their choices in how they convey information, and more importantly, who they are targeting with their material is significant. Even though women have different ideas and perspectives on programming, informed by their experiences, they submit proposals to write books less often than men. That’s something I hope to help change.

Here’s another program that uses the Fibonacci sequence to make turtle art:

#This code prints the Fibonacci numbers starting from 0 up to 13
#And uses the turtle module to visualize the sequence
import turtle
import math

#Change the window background to pink
turtle.bgcolor("pink")

#Set up turtle and list➊
turtle.colormode(255)
turtle.speed(0)
num=[]

#Draw the turtle based on Fibonacci sequence
def moveTurtle(listOfInts):➋
  if len(listOfInts) <= 3: #Don't draw turtle until enough numbers calculated
  return
  #Move the turtle forward based on last number of sequence
  turtle.forward(math.log10(listOfInts[-1]))

  #Assign turtle color based on last three numbers of sequence
  rgb = ((listOfInts[-1])%255, (listOfInts[-2])%255, (listOfInts[-3])%255)➌
  turtle.pencolor(rgb)

  #Turn the turtle right 90 degrees
  turtle.right(90)

#Calculates a list of the first x numbers of the Fibonacci sequence
def fib(x):
  if x == 0: #Return when done
    return
  if len(num) == 0:
    #Start at base case 0
    num.append(0)
  elif len(num) == 1:
    #Add 1 to the base case and assign to next index in list
    num.append(num[0] + 1)
  else:
    #Add the last two numbers together
    #And append the new number to the list
    num.append(num[-1]+num[-2])
    #Pass list to draw turtle
    moveTurtle(num)➍
    return fib(x-1) #Calculate next number in sequence

fib(800)

This one takes the Fibonacci sequence and draws art using a turtle. I first set up the turtle by setting its drawing speed to 0 ➊, the fastest setting, and making its colormode 255 so that it accepts RGB colors. Then I added a moveTurtle() function that creates a turtle and makes it turn in a tight spiral pattern by moving the turtle forward the log of the last calculated Fibonacci number in the sequence ➋. The turtle changes its pen color by converting the last three computed Fibonacci numbers into an RGB color and turns right ➌. Then I added a call to moveTurtle() in the recursive function that calculates the Fibonacci numbers so that the turtle draws a line representing the newest calculated number each time ➍.

The output looks like this:

rainbow Fibonacci spiral with pink background

I don’t program regularly and even though it’s not a job the pipeline typically flows into, programming has still been incredibly important to my job and I’ve been able to help others learn to code, too. I think that’s a success rather than a failure. As more people learn to code, they may bring programming to jobs that are traditionally non-technical as well. Rather than a pipeline that leads women straight into tech jobs, we might actually be developing an irrigation system to nurture a whole spectrum of careers similar to mine that incorporate programming in unconventional ways. I’m excited to see that grow and to be one of the helpers making resources available for others.

Jan has worked as a Japanese to English translator, as an assistant at San Francisco’s Kinokuniya bookstore, and now as an editor for programming and STEM books at No Starch Press.