How to teach girls in your stake computer programming


Photo by Queen Scarlett [2]

This is a report back on a successful Saturday activity I ran in our stake this year (what is a stake? see note at the bottom of the article). I hope to convey enough detail that others can replicate this activity in their stakes, spreading the joy and usefulness of coding far and wide! The purpose of the activity was to teach all the girls in the stake, ages 8-18, how to write computer programs, and contextualize the importance of developing divine skills (such as coding) within the gospel. In my day job, I teach computer programming to undergraduate and graduate students, and I’m passionate about broadening participation in our field to include more women and people of color. This activity was, for me, a unique opportunity to bring my professional and gospel lives together. I had a blast, and so did the girls!

The secret sauce: SERVICE

There, I gave away the secret sauce recipe here in the first section: it’s all about service. Research shows that one reason the tech industry has so few women is that after being equally interested in STEM (science, technology, engineering and math) in elementary school, girls turn away from STEM in junior high. One reason for this is that girls at that age are highly influenced by an altruism motive. This manifests in interests and aspirations associated with helping cute, helpless things: veterinarian, teacher, caring for babies, rescuing animals, radicalizing on environmental issues, etc. Unfortunately, girls don’t associate STEM with helping people, and often our attempts at outreach for STEM exacerbate this (“Come learn to program and make yourself a millionaire overnight founding a meaningless startup!”). My goal was to show that there is a strong association between STEM (and working towards developing talents generally) and service to others.

The message isn’t “come learn how to code,” it’s “come learn how to help other people–who really need your help!–learn how to code.”

A service-centered activity structure

The structure of the day was as follows:

  1. Morning: Teach the Young Women (ages 12-18) only (about 2 hours)
    1. Keynote remarks on the importance of service
    2. Teach the YW just enough computer programming to enable them to teach a lesson to the Activity Day girls, coach them on the lesson plan.
  2. Lunch!
  3. After lunch: Young Women (ages 12-18) teach the Activity Day girls (ages 8-11) (1 hour)
    1. Binary (ASCII) code bracelets
    2. Javascript greeting card

I couldn’t be happier about how well the event’s structure turned out. The young women took an hour and a half of code instruction, and turned around and taught those younger girls like pros! Of course, the younger girls idolize the older ones and felt so special when the older ones paid attention to them. I’ve done other events with 8-11 year old boys and girls, and it is a struggle because they need lots of one-on-one support for these lessons. This format ran so smoothly, because each young girl had one or two teachers working directly with her. I really didn’t need to do anything after lunch.

Lesson details

The following is a detailed walk-through of the morning lessons. In our case there was a fantastic keynote about service preceding my service remarks below, but the below also introduces the service theme. I’m going to intersperse talking points with my slides [3]. Some of the talking points are nearly verbatim from what I would have said aloud at that point, and others in more summary form. After the slides-driven portion it turns more free form, but I’ll walk through that carefully as well.

Lesson Part 1: Service and 2 “secret codes”



God created everything, and we are His children. We all have within us talents and creative abilities! President Uchtdorf said, “The desire to create is one of the deepest yearnings of the human soul. No matter our talents, education, backgrounds, or abilities, we each have an inherent wish to create something that did not exist before. Everyone can create. You don’t need money, position, or influence in order to create something of substance or beauty.”



Developing talents takes a lot of time and effort, but it’s not selfish to spend that time developing a talent. My friend in the photo on the top left has a PhD in vocal performance—she has spent years and many hours developing her talent. She uses it to bless others by doing many performances in our stake and in the community. Having a highly developed talent or skill makes us more effective at giving service, because we can serve in ways that others can’t. Whether it’s knowing how to tend a garden or jumprope with a friend, or using years and years of training to perform medical care for infants and others in need, knowledge is what enables us to serve.


Superheros are one of the best examples of this principle. Can you name the special power each of these characters has? How do they use those powers to help others? Who is your favorite superhero? How do they use their powers to serve others?


[Read text on the slide.] At this point, I pulled out a cape and put it on.


Answer to the mystery: I can code! Writing computer software helps us do all kinds of things that help individuals and families, and many of them feel like magic! Code just like what you see on the slide–but LOTS of it–is what enables FaceTime and Skype to connect families, what makes Google’s self-driving car go, and all the other amazing technologies that are out there. Knowing how to code is like having a superpower.

If you aren’t (yet) a coder: I know what you’re thinking–I couldn’t give this lesson, I’m not a coder! Well, never fear. After following the lesson below, you will know enough. (Just ask the young women who taught this lesson to the girls after only 1.5 hours of learning!) You’ll of course need to change out the details of the next few slides for ones more relevant to you. But trust me, you CAN teach this lesson!

My superpower is better than a movie superhero’s power, because they can’t give their superpower to someone else. Knowing how to code has helped me serve others by sharing my superpower with them!


Having a special talent also leads to many fun opportunities. I got to go to New York for my job, and to a party at Pinterest headquarters!


My kids think it’s pretty special having a mom who knows how to code. I take them with me to school and work, like this trip to Googleplex (Google’s headquarters), where they got free Google sunglasses. I’m teaching them to code, too!


Now I’m going to share my superpower with you! To make the computer do all these amazing things, we just need to know how to talk to it. We have to talk to the computer in secret codes–fun! Today we’re going to learn 3 different secret codes.


Attention activity: what is your favorite class at school? [Get responses.] You all have talents in many different classes at school! The computer isn’t as talented as you! It is only good in math. The reason we have to talk to the computer in code is that a computer is only good at one thing: math. So the way we get it to do other things that are exciting to us is to change those things into “secret codes” that are just numbers. Then we trick the computer into thinking it’s doing math for us, when really it’s making pictures and videos and sounds and everything else.


The first code we’re going to learn is the code for making colors on the screen of a computer. It’s called RGB. [Read text as appears on next few slides.]




[The answer is YELLOW because the red and green numbers are the highest they can be, while blue is very low (nearer to 0 than 255), and we see in the “Hint” picture that red and green combined makes yellow in RGB.]

RGB colors don’t combine like we’re used to! That’s why we need that hint image.

[I skipped the next few slides, but they provide some fun context for older kids who know something about matrices/arrays.]




[end of skipped section]


The next secret code we’re doing is ASCII, which is how the computer represents letters, punctuation, and words. Review the next few slides, then do the activity with binary necklaces described here. The Thinkersmith lesson plan that goes with the binary necklace (see link over at the necklace page) has plenty more details on RGB and ASCII if you need some quick study yourself on those parts before feeling comfortable teaching them. For the record, I did this whole lesson for a group of 8-11 year old boys from the school, and they loved the necklace activity just as much as the girls. Some of them left it as a strand, so it could be a thing that dangles off their backpack rather than a necklace.






Lesson Part 2: 3rd “secret code,” Javascript

For this part of the lesson, I used Khan Academy’s coding lessons (go to Khan Academy -> Subjects -> Computing -> Hour of Code -> Start coding now). One reason for using Khan Academy is that their in-browser environment is very well built and requires no installation of software. If girls want to save their creations to work on at home or share with family they may register for a free account on Khan Academy. However, registration is not required to complete the activity. Another reason for using Khan Academy’s lessons is that they include extensive automated tutoring, so the pressure is off the young women (and you!) to remember every step and detail of the lesson.

For the lesson, skip right to “Challenge: H for Hopper,” verbally explaining the x-y coordinate plane as needed. If you aren’t a coder yourself, you’ll want to watch the videos leading up to this activity, then you’ll be 100% prepared to teach it, promise!

From there we skipped again to “Challenge: CRAZY Face.” Note that here students use their RGB secret codes to set the colors of the parts of the face–neat! If you follow the next few videos after CRAZY Face, you’ll learn how to add text and image “stickers” to the page. Without having the girls watch those videos, I just verbally demonstrate the commands to do it. So we continue to work in the CRAZY Face base page. I encourage the young women to customize the face until it is a greeting card for their soon-to-be-arriving Activity Day girl students. For example, they could write “[name] is awesome!!” and add some fun stickers.

As a super bonus feature (optional), you can show them that we can replace constant numbers (say, 200 and 200) for the x and y of a shape or sticker, and instead use “mouseX” and “mouseY.” This has the effect of setting the x and y values (the placement) of the object to the same place as the mouse, so it moves all around–cool! Here is the completed code I wrote:

var draw = function () {

    background(175, 237, 250);

    fill(255, 213, 0);
    ellipse(200, 200, 200, 200); // Makes the face

    fill(255, 0, 0);
    ellipse(160, 170, 80, 80); // Makes the eye

    fill(21, 0, 255);
    ellipse(235, 170, 30, 30); // Makes the other eye

    fill(255, 0, 234);
    ellipse(195, 245, 75, 20); // Makes the mouth

    text("Code is awesome!!", 50, 50);

    var pic = getImage("avatars/old-spice-man");
    image(pic, mouseX, mouseY);


And here’s what it looks like in the browser, with the image it creates:


Required materials

Here’s what you need to put on this event:

  • Laptops: We asked each girl who was able to bring a laptop, chromebook, or iPad (with keyboard). The only requirements are: (1) run a web browser, and (2) have a keyboard for typing the code (it’s probably too difficult to do with iPad’s on-screen keyboard). There is no software to install. We were fortunate to have someone in the stake bring a dozen laptops for those who couldn’t bring their own. In a slightly more scarce situation, sharing in pairs could work well (in fact we shared between the young women and activity day girls).
  • Projector: Not strictly required, but I used a projector for my slides. It also really helps to project my code on the screen, so the girls can type each word as I type. Your church building might have a projector and/or screen, or borrow from some lucky person in the ward/stake.
  • Wifi, power: You’ll need wifi (available in most meetinghouses, just be sure your room has good signal and that you know the password), and lots of power strips/extension cords.
  • Necklaces: Beads, cords, and closure hardware for the necklaces, see link to the necklace activity web page.
  • Food: for lunch.


[1] Many of the photos in the slides are from the church’s media library, and others are my own. The image of the Incredibles falls under Fair Use because we were discussing the movie and character development. Lesson plan materials from Thinkersmith are credited where used.

[2] Event photo is courtesy of Queen Scarlett, of the blog Frankly, My Dear….

What do the terms “stake,” “ward,” “Young Women,” and “Activity Day girls” mean? I ran this event as part of the youth programming for my church, The Church of Jesus Christ of Latter-day Saints (Mormons). A local congregation is called a “ward,” and several local congregations are grouped into an organizational structure called a “stake.” The youth group program for girls ages 8-11 is called “Activity Day” and the youth group program for girls ages 12-18 is called “Young Women.” These titles are used in this writeup as shorthand for these age demographics. Of course the design of the activity would work well for any group of 8-18 year old girls (school group, church group, Girl Scouts, etc).


  1. Completely fantastic, Cynthia. Bookmarking this in case I get called to work with YW or Activity Days girls again.

  2. Bro. Jones says:

    This is FANTASTIC, both from a church perspective and just a plain ol’ pedagogical one. Mind If I steal this and suggest it for use in my ward/stake?

  3. lowbrow says:

    This is awesome!! I have worked as a software engineer and I have always said programming is a creative endeavor. I have never thought of it as a service oriented job. Thank you.

  4. Jason K. says:

    Cynthia: the only thing more amazing than you is you in a cape! This wins on so many levels.

  5. Absolutely great. Let your Arduino-programmed LED so shine…

  6. maustin66 says:

    This so reminds me of the original purpose of the Mutual Improvement Association, which was (wait for it) mutual improvement. What a wonderful lesson and set of objectives designed to empower, rather than simply indoctrinate, our youth. The next time you do this, let me know so I can put my 13 year old daughter on a plane to Palo Alto.

  7. I love that you do this, Cynthia! And thanks so much for sharing it here!

  8. Bravo! Fabulous workshop!

  9. it's a series of tubes says:

    Two thumbs up! Going to steal some of this for a spring break activity for my daughters :)

    Thanks much! Takes me back to the days of learning to code up a slot machine simulator on a TI-99/4A when I was a kid. Set me on a career path I never got off.

  10. This is so great. I love that you included mentoring as part of the workshop. I have offered programming as an activity to the YW in my ward (YM did a 6 week project resulting in space invaders) but they haven’t accepted. :(

  11. Abu Casey says:

    This is fantastic! Thanks for sharing!

  12. This is really fantastic. Thank you!

  13. This is truly great. Any chance you have a video of the event so that those of us not in the Bay Area can convince our neighbors that this is awesome and we need to do this yesterday?

  14. Thanks for being so very reassuring for those of us who don’t already know how to code. I’m hoping to be able to share this!

  15. Are you doing this in a LDS Church? We are trying something a little more primitive in a Branch in Masaka, Uganda.

  16. What a great idea. Thanks for sharing.

  17. Teaching skills is always a great idea, but I am not understanding why girls and people of color are the only candidates for learning. Interests in computer programming is largely a market-driven employment niche. There seems to be very little demand for recreational coding except for those who already have jobs in the industry. Why suggest otherwise? Wouldn’t it be more useful to teach practical skills, instead of trying to force changes in a social dynamic? This seems related to encouraging kids to graduate from college even though there are no jobs to be found in their chosen specialty on graduation.

  18. ErinAnn says:

    Thank you for this! I have passed this idea along to my ward Primary leadership.

  19. Absolutely fantastic Cynthia! Just one honest question. I can’t tell from the material whether you dance around the whole “job/career” thing as a way to serve or whether you say it out right. Clearly it is *strongly* implied, but is talking about things in terms of a job or career directly problematic for your purposes? Did you feel it would it be a turn off to the girls or go against the altruism to the point you felt you had to sneak it in? Was it concern about what parents might think?

    Bo Gritz – I don’t get what you are saying. There are tons of non-market opportunities to serve with the ability to code. Ie Cynthia couldn’t have put together this awesome activity if she didn’t…wait for it…*know how to code*…and how to teach this material so well which she happens to do professionally (at Stanford no less). Also, I think as Cynthia was saying throughout the market opportunities to serve humanity through coding are enormous. It is always wrenching to me that so often we tell girls (or imply) that they can serve their fellow humans as long as they don’t get paid for it. Then somehow that it becomes a less pure activity. I think what you are saying if this was done for a boys activity (and it should definitely be done for boys as well) that we would be all like – “learn to code so you can get a high paying job”! That wouldn’t upset the “social dynamic” and be A-ok? But if we say that to girls it is some sort of “forcing” change?

  20. rah, My thinking was that the real win in terms of promoting careers for women was simply in seeing me on stage as a role model who has a full time, serious career. That action speaks louder and more effectively than words, and so it wasn’t really necessary to hammer that explicitly in the talk. Next, I didn’t want any of the women leadership and visiting moms in the room (not one male “chaperone” was there!) to be made to feel less-than by my remarks. If I made it sound like “having a career rulez, staying home droolz,” that would reflect neither my own true feelings, nor be fair in honoring other choices. Finally, I was a guest speaker at the invitation of the Stake Presidency and stake YW leadership, so I wanted to be firmly “on message” for the day, which was service.

    Bo Gritz, “I am not understanding why girls and people of color are the only candidates for learning [coding].” Actually, my concern is that, in practice, the opposite has been true: society has treated white and Asian males as the only candidates for learning coding. Like you, I feel it is wrong to treat any one group as the only candidates for learning, and so I am just trying to balance things out. So we share the same underlying belief and concern–wanting everyone to have equal access. And don’t worry, I still spend all day every day teaching audiences that are overwhelmingly white and Asian males to code.

  21. Brian, alas, there is no video! Happy to correspond with anyone from your stake who has questions, though.

    rogerdhansen, we held it at the stake center, which, thanks I’m sure to some geeky person in the stake, has really terrific wifi. I should have added wifi access and lots of power strips/extension cords to the materials list.

    Bro. Jones, PLEASE do!

  22. Kyle M. “Absolutely great. Let your Arduino-programmed LED so shine” ftw.

  23. Michael says:

    Bo – I think I’ve met you. Are you one of those roommates I had in Provo who thought that the only acceptable fields of study for women were nursing, home/family sciences, or early childhood education, and any other field of study was depriving some priesthood holder of an education and job to support his family?

    Recreational coding has more benefits than you could possibly imagine. I grew up on a Commodore 64, writing all sorts of programs with no commercial viability whatsoever. But, there’s not a single day at work where I don’t use the techniques and logic I learned on that thing in my current finance job. Anything that expands a girls’ horizons of what they can do and accomplish is a good thing.

    Besides, there’s no point in trying to teach the young men. All they want to do is play basketball in the cultural hall.

  24. var draw = function () {
        background(175, 237, 250); // Comment

  25. Cynthia,

    Totally agree on the actions are better than words and completely respect your dance and the reasons for it. I think it is really sad that there is still this latent idea that there is implied judgement of different life paths by directly acknowledging one as valid. As you know I find it super disappointing that the sensitivities are so gendered. No one in the stake or in the audience would give a second thought if you directly mentioned just the possibility of a career in the context of learning how to code if it was an audience of boys. In fact, I would reckon that would be the primary framing if done for boys. But because its girlz we can’t even say it aloud *as a possibility* – in the South Bay! If we have to be so circumspect there so as not to offend (what ?some sense of orthopraxy?) what does that say to all the women and families that follow this path? And in a world where the church is pushing I am Mormon video of dual career couples with young kids and a mother as primary breadwinner. So total respect for you – total disappointment that we as a community can’t seem to do better to acknowledge career women as equally orthoprax saints. Girls of course pick up on these subtle messages.

    But again, just awesome work! We have been looking to create YW activities as part of AWM. We will definitely refer people to yours as an great example and encourage them to copy it!

  26. Aaack! I wasn’t able to preserve indent and tab spacing.

  27. Rachael says:

    This is amazing! I was just called as an Activity Days leader yesterday. Totally going to do this with my girls–thank you for sharing this!! I don’t know how to code myself, since all of my degrees are in the humanities, but I’m excited to learn. :-)

  28. rah, I would guess that an explicit career day activity for YW would be a well received idea in this stake (I know that’s not true in every stake). I know only two of the stake presidency’s wives, and both have careers. This day was about service, so that’s why I tried to stay “on message” in terms of that message. I shouldn’t have made it sound like the stake would have frowned on it per se.

    The mommy wars and perceived implicit criticism of different choices in unfortunate but hardly limited to Mormonism. I thought I was pretty explicit in splashing some of the benefits around (travel, fun, etc). Financial independence etc is off the altruism message and in any case hard for girls this age to relate to.

  29. Emily U says:

    Brilliant, Cynthia! I would never have thought of pitching this as learning to serve like a superhero, but it’s brilliant.

  30. Johnna Benson Ferguson says:

    A great lesson plan, but what really blew my mind was connecting STEM to the altruistic motive. I’m rethinking how I talk to my youngest about her future to include the satisfying altruistic side of STEM. As well as creativity.

  31. Mark, fixed it for you. There’s nothing worse than code that isn’t properly indented. Nails on a chalkboard.

  32. Chill Robr G Manspalinin' says:

    Let me add my voice to the chorus of others rightly congratulating you on providing a wonderful activity for young women. I do, however, think you missed a golden opportunity to interject some of the most important Book of Mormon concepts as well as providing a motivation far greater than altruism. Simply replace the slide “secret codes” with “secret combinations”. Altruistic service instead becomes a motivation to defeat the greatest evils described by ancient prophets. Starting off with an accurate description of Silicon’s Valley beginning might convey a sense of urgency. While most people think of Silicon Valley as being founded by acid dropping, India traveling, barefoot non showering arrogant hippies you could instead tell them the truth. That Silicon Valley owes its genesis to the paranoid genealogist Shockley and his compatriot Fred Terman (whose work is still secret!) both of whom reaped huge sums of money securing defense contracts to help defeat the Evil Empire. And while you’re clearing up that misconception you could also describe what the original computers were used for: ENIAC was computing ballistic tables for the Army, Von Neumann was calculating the propagation of shock waves for nuclear weapons, and Joseph Desch was breaking secret combinations with his bombes. And today’s self driving cars? A DARPA funded Grand Challenge to automate war. See? Computing becomes way more fun when the entire fate of the free world hangs in the balance.

    Noticeably lacking in the Book of Mormon is the female version of the Stripling Warriors, but here too, progress can be made be appealing to other Book of Mormon prophecies. Modern day Gadianton Robbers. Russian hackers stealing billions of dollars from British banks. People’s Liberation Army Unit 61398 stealing highly classified defense secrets. And there’s always the North Koreans along with the occasional Dread Pirate. Gadianton Robbers indeed. Let them know that the most powerful group of all, the Equation Group, desperately needs coders to fight the good fight. And as per law, they actively encourage women and minorities to apply.

    As an expert in high performance computing, it’s somewhat disappointing you didn’t take them on a field trip to see some of the world’s fastest supercomputers at Lawrence Livermore simulating nuclear weapons explosions. Or down to Oak Ridge to see the breaking of Advanced Encryption Standard with a suped-up Jaguar. Maybe next time.

    Oh, and then there’s the Israelites, Zion, and Armageddon which after Netanyahu’s speech will sound like it’s right around the corner. Very timely indeed. And way more motivating.

    You could finish your lesson with the Grace Hopper’s coding equivalent quote of Laurel Thatcher Ulrich’s quote “Well-behaved women seldom make history”: “it’s easier to ask forgiveness than it is to get permission”

  33. N. W. Clerk says:

    “I still spend all day every day teaching audiences that are overwhelmingly white and Asian males to code”

    Wow, I had no idea that the teaching loads for Stanford faculty are that heavy!

  34. :-) If we count time students spend solving coding assignments I’ve given them as “teaching” them, it is true….

  35. Thanks, Cynthia. Writing clean and easy to read code is a way to teach the students the importance of creating something that others will be able to use and understand. That lesson can translate to lots of areas of life, work related or not.

  36. Mark,

    I’m going to be that guy. In javascript, your comment is improperly indented. Though I prefer your indentation style, in javascript it is explicitly wrong. :(

    Also, you omitted the trailing semi-colon (Cynthia includes it), which is sort of required when declaring a function in this way.

  37. I should be more precise: the code in the comment that Mark left is improperly formatted. The comment in the code itself is fine. Javascript requires that you open the curly brace on the same line as the statement that calls for it rather than a standalone curly brace on the following line. Though the standalone (unindented) is the one true style as far as I am concerned. The fact that javascript doesn’t conform to proper style is just another of its many warts.

  38. There, I fixed that too.

  39. Clearly we need version control on these comments.

  40. Hi John, perhaps I’m using an different version of JS than you on my browser, but my original code worked fine without errors. The little snippet was just to demonstrate the importance of leaving behind something another person could not misunderstand. Something as simple as lining up squiggly brackets { the technical term I use in class } or indenting comments can make a positive difference later on. Or for a non-coding teenager, putting your shoes away in the closet is the difference between finding them again in the morning, or being late for the bus.

    My fault in the first place, ’cause I was that guy with my first comment.

    This project would be cool to do with the youth in my ward, and I like how Cynthia tailored it to maintain the interest of the girls.

  41. I’m not sure why, but this made me so happy I got teary eyed. Really.

  42. Bo Gritz- “Wouldn’t it be more useful to teach practical skills, instead of trying to force changes in a social dynamic?”

    I can’t think of very many skills that are *more* practical than programming in 2015.

  43. Mel, you’ll have to trust me that our friend Bo Gritz has an even more spectacular comment being held in moderation.

    Aw, thanks, SteveP.

  44. Release the comment!

  45. Cynthia, and I didn’t think it could be done after that first one!

    Oh well, I’d better get back to my coding now :)

  46. I love this. Thank you. I lived in the bay area as a 12-14 year old and would have loved something like this. I was lucky to have good math teachers but didn’t do any sort of coding until a pascal class at BYU. I was always behind in the class. I did a lot more programming but in SAS and now those skills are sadly atrophied.

  47. “having a career rulez, staying home droolz”
    I am making t-shirts with this phrase immediately. (Kidding..)
    As a mom of 4 kids who still chooses to work part time, I think it’s great to encourage young women to learn skills they can use throughout their lives. They need problems that challenge them, they need opportunities to discover what they love, they need to gain a passion for education.. this event seems to do all three. LOVE IT.

  48. Hope you’re still checking comments on this! I’m using this activity with my Activity Day girls this week and would love to use your slides, if you’re willing to share. Please let me know, and thanks for making this so accessible! I have an English degree and no experience, but the tutorials were a snap.

  49. I’m so glad, Lauren! Slides sent!

  50. John Mansfield says:

    You may find useful as precedent and inspiration the teen-aged girls who operated the Deseret Telegraph. A bit about two of them can be found here: Morse Code Girls.

  51. John that’s an awesome connection. I will definitely file this away. Thanks.