COVER
ABOUT THE BOOK
ABOUT THE AUTHOR
TITLE PAGE
DEDICATION
OUR GIRLS WHO CODE
HELLO, WORLD
1 WHY CODING?
2 HOW TO TALK TO YOUR COMPUTER
3 PUTTING IT ALL TOGETHER
4 GETTING STARTED
5 CRACKING THE “CODE”
6 DEBUGGING
7 VIDEO GAMES
8 DIGITAL ART AND DESIGN
9 ROBOTS
10 WEBSITES, MOBILE APPS, AND ONLINE SECURITY
CONCLUSION
GLOSSARY
ACKNOWLEDGMENTS
COPYRIGHT
ILLUSTRATOR: ANDREA TSURUMI
WRITING PARTNER: SARAH HUTT
TECHNICAL ADVISOR: JEFF STERN
EDITOR: KENDRA LEVIN
ART DIRECTOR: KATE RENNER
This ebook is copyright material and must not be copied, reproduced, transferred, distributed, leased, licensed or publicly performed or used in any way except as specifically permitted in writing by the publishers, as allowed under the terms and conditions under which it was purchased or as strictly permitted by applicable copyright law. Any unauthorized distribution or use of this text may be a direct infringement of the author’s and publisher’s rights and those responsible may be liable in law accordingly.
Epub ISBN: 9780753552070
Version 1.0
1 3 5 7 9 10 8 6 4 2
Virgin Books, an imprint of Ebury Publishing,
20 Vauxhall Bridge Road,
London SW1V 2SA
Virgin Books is part of the Penguin Random House group of companies whose addresses can be found at global.penguinrandomhouse.com
Copyright © Girls Who Code Inc. 2017
Cover art copyright © 2017 by Girls Who Code Inc.
Cover design: Kate Renner and Two Associates
Girls Who Code have asserted their right to be identified as the authors of this Work in accordance with the Copyright, Designs and Patents Act 1988
First published in the United Kingdom by Virgin Books in 2017
First published in the United States by Viking in 2017
www.penguin.co.uk
A CIP catalogue record for this book is available from the British Library
ISBN: 9780753557600
This book is dedicated to all the girls who code and to the girls who will one day.
BIRTHDAY: May 20th
LIKES: science, music, video games, emojis, trying new things
BIRTHDAY: November 13th
LIKES: sports, sweatpants, babysitting, nail art, taking selfies
BIRTHDAY: June 3rd
LIKES: writing, drawing, fashion, chunky jewelry, giving advice
BIRTHDAY: February 26th
LIKES: baking, theater, reading, surfing, doing silly impressions
BIRTHDAY: August 22nd
LIKES: robotics, gardening, field hockey, crafting, hanging out with her big sister
I’M RESHMA, and I’m the founder of Girls Who Code.
Our organization helps girls in middle school and beyond learn to write code that’s used to program computers and digital devices and get inspired by all the amazing ideas, skills, and opportunities that learning to code can bring.
And, believe me, there are tons.
But I’ll let you in on a little secret: UNTIL A FEW YEARS AGO, I WAS AFRAID TO LEARN HOW TO CODE.
My background is as a lawyer and politician. I’ve served as the deputy public advocate for New York City, and in 2010, I was the first South Asian American woman to run for Congress. I’ve always loved meeting new people and helping out in my community. That’s why I was drawn to politics. Ever since I was a girl, I’ve aspired to do something that would make a positive difference in people’s lives. I just never imagined it would be through computers or coding.
But when I was running for office, I spent a lot of time visiting New York City schools. That’s when I noticed something.
In every computer lab, I saw dozens of boys learning to code and training to be tech innovators. BUT THERE WERE BARELY ANY GIRLS!
Where were they?
This didn’t seem right to me. I knew that women make up a majority of college graduates and almost half our workforce. But when it came to computer science, or CS, the study of computers and the different ways they can be used, women weren’t anywhere to be seen (at least in New York City’s schools). And that’s a problem.
By 2020, there will be 1.4 million open jobs in computing. These jobs are some of the country’s highest-paying and fastest-growing career paths. BUT GIRLS ARE ON TRACK TO FILL JUST 4 PERCENT OF THEM.
Just 4 percent? If this were a pie chart, that wouldn’t even qualify as a slice!
To me, this is unacceptable. Girls are missing out on the jobs of the future, all because they are not learning to code.
Why is this happening? Why weren’t there more girls in those classrooms?
It got me thinking about why I’d never learned to code.
It wasn’t because I didn’t have plenty of opportunities to study math and computing; after all, my dad is an engineer. When I was growing up, he loved to share science ideas with me and would always ask me math questions on the fly, usually during dinner. But it was hard for me to work out the answers in my head. A lot of times I knew the answer, but I couldn’t figure it out right away. And those moments of not knowing and staring at my dad’s face across the table made me feel like I wasn’t smart enough. Dinner became an anxiety-filled event for me, and I started to believe I wasn’t good at math.
Then I became scared of it.
So I avoided it, and any subject I thought required math—including coding, statistics, and engineering—and focused on history and writing, where I was more comfortable and knew I would do well immediately.
I didn’t realize it at the time, but I wasn’t alone. Thousands of girls of all ages tell me the same thing: that they’re just “not good” at math or science. They tell me they’re scared of subjects that seem too technical, like coding. Or even if they’re not scared, they think computer science is not “for” them—that it’s not social enough, and it’s for boys who like to sit at computers all day.
Well, let me tell you another secret:
THAT IS COMPLETE AND UTTER BALONEY ON A ROLL! (hold the mayo)
It turns out that from an early age, we’ve been fed the message through stereotypes, social cues, and sometimes even from educators that science, technology, engineering, and math, or STEM, is “not for you.”
If you start looking for these signals, you’ll see them everywhere. I can walk into a popular retailer for teen girls and buy a T-shirt that says ALLERGIC TO ALGEBRA. Or I can watch any number of TV shows depicting a programmer as a guy in a hoodie alone with his computer in his basement.
As girls, we’re listening. And you can see the impact of these negative stereotypes and lack of role models in the numbers. By middle school, most girls say that STEM careers are not for them. By high school, girls are ranking engineering, computing, and math as some of the least interesting professions.
Girls are being slowly steered away from STEM subjects before they can find out if they actually like them, and, more importantly, before they can find out that they are actually amazing at them.
In 2010, I lost my race for Congress. That was hard for me. As a lifelong high achiever, I had never failed at anything before, and it took me a while to figure out what to do next. But it also made me realize something that changed my life: my decision to run for Congress took a lot of courage. I had to be brave, and even though I failed, I knew that I had tried. I’d reached outside my comfort zone and done something new, something different, something scary. It made me wonder if, had I done that all those years ago at the dinner table or in school, I might have discovered that I loved coding or math or science.
That’s when I knew it was time to be brave again and use what I’d learned to try to change the game for the next generation of young women.
I decided I was going to teach girls to code. It was an experiment, and I started with a classroom of twenty girls in New York City. I convinced a friend to lend me a conference room at his company and went door-to-door to recruit the first students. I had no idea how people would respond, but I knew I had to try.
TODAY, GIRLS WHO CODE HAS BUILT A MOVEMENT. We run one hundred summer programs and thousands of after-school clubs for middle- and high-school girls. We’ve reached tens of thousands of girls in every state in the country.
GUESS WHAT?
It turns out, girls are really good at coding!
They can build incredible things!
And they have fun doing it!
In this book, you’ll read about some of my favorite creations made by real girls: from a game to help young girls see themselves as beautiful to a lighting system that can sense the beat in music and create light displays to match. When you learn to code, you give yourself a tool, a tech super-power, to create change in your community. You use your voice, your mind, and your skills to find solutions to problems to help your country. And you start to build a better world for each and every one of us.
Not to mention you can make great friends and have an awesome time, too.
SO WHAT ARE YOU WAITING FOR?
This book will teach you how to be a girl who codes and how to build amazing things. You’ll learn the same fundamentals of coding that we teach in our Girls Who Code classrooms. You’ll get an introduction to projects and the fun of learning how to code through games, art and design, robots, website and mobile apps, and online security. We’ll also introduce you to women and girls doing incredible and inspiring things with code. I bet you’ll come away with a burning desire to start creating and join our movement of girls around the country and across the world.
READY TO BE BRAVE? LET’S DIVE IN!
WELCOME!
Yes, you! The one reading this book. So glad you made it.
What brings you to coding?
Maybe you’re already into COMPUTER SCIENCE and want to learn how to do more.
If so, that’s great!
Maybe a parent or grandparent or teacher told you that coding is a valuable skill for your future and made you sign up for a class, but you’re not really sure if it’s for you.
That’s okay, too.
Maybe you don’t know anything about coding and just liked our cover art.
That works for us!
Whatever the reason, we’re glad you’ve picked up this book, and we’re glad you’re here. And you’re in good company!
The first thing to know about coding is that it’s about way more than just computers.
It’s about having fun.
It’s about collaborating with your friends.
It’s something everyone (not just boys) can do.
And it’s about creating, imagining, and inventing awesome new stuff based on whatever you’re interested in.
Like turning a toy car into a robot. Or making a WEBSITE* for your dog-walking business. Maybe you want to DESIGN a smart bracelet that can remind you when to do your homework or practice the piano. Or an app to keep track of your sprint times when you’re training. How about an interactive sound and light display for the next school play? Or an LED headband that can change color to match what you’re wearing?
You can do all this stuff, and a whole lot more, by learning to code.
And I’ve got some news for you:
The major, earth-shattering trick to COMPUTER CODING is … … it’s mostly problem-solving!
The actual code-writing part is just a small piece of a process that uses the thinking and planning skills you already have and use every day in your life.
So let’s get started.
First of all, who can tell me what coding is?
That’s right.
Coding is, very simply, writing commands to instruct a computer to do something in a programming language it can understand.
There are actually hundreds of different programming languages used to give instructions to a computer. Which one you use depends on what you need the computer to do. When you learn to code, you learn to “speak” one of these languages so that you can communicate directly to the computer.
Because coding is an amazing tool that will allow you to use your computer in ways you haven’t even dreamed up yet. Sure, you can already do stuff on your computer, your tablet, or your phone, but that’s because at some point, somewhere, a programmer had an idea for that app or program, then wrote the CODE to make it work. That person’s code created the icons and buttons and shortcuts you use to control your device. This is the software that runs the machine. But using software is not the same as writing code.
By learning to code, you no longer have to just use the programs and apps that somebody else created—you can build them yourself! Like a best friend birthday reminder app, or a website for your drama club.
SOFTWARE is the set of programs and applications that make a computer run. It’s a collection of code, designed and written by programmers. Software includes everything from apps that let you put fun filters on your photos to games that let you take care of a virtual dog or fight villains. Software also includes the computer programs that let you write your English essay.
HARDWARE refers to the physical parts of the computer itself: the screen, the keyboard, the camera, and more. These are usually designed and built by engineers. Your phone and tablet are also examples of hardware.
Another great reason to learn to code: it helps you understand, design, and work with the technology of the future.
There’s a computer in almost everything, including cars, games, medical devices, and clothes. There are even smart toothbrushes!
If an object doesn’t rely on a computer right now, chances are good that, in a few years, it will. And every one of these digital devices depends on a programmer writing code to tell the machine what to do and how to do it.
Yes! Without a programmer writing code, a computer would just be a big box. Because even though today’s computers can do amazing things, they are still machines that, at some level, need to be instructed by a person.
Think about the microwave in your kitchen. It won’t just randomly start heating up your leftover mac and cheese because you want it to. You have to put your dish in the microwave, close the door, set the timer, and push Start. The machine performs the task you instructed it to, and at the end, you pull out your warmed-up snack. The whole sequence happens because you decided you were hungry and programmed the machine to do what you wanted.