cover

Contents

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

Image

This book is dedicated to all the girls who code and to the girls who will one day.

OUR GIRLS WHO CODE

Image

BIRTHDAY: May 20th

LIKES: science, music, video games, emojis, trying new things

Image

BIRTHDAY: November 13th

LIKES: sports, sweatpants, babysitting, nail art, taking selfies

Image

BIRTHDAY: June 3rd

LIKES: writing, drawing, fashion, chunky jewelry, giving advice

Image

BIRTHDAY: February 26th

LIKES: baking, theater, reading, surfing, doing silly impressions

Image

BIRTHDAY: August 22nd

LIKES: robotics, gardening, field hockey, crafting, hanging out with her big sister

HELLO, WORLD

Image

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?

THE PROBLEM

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.

THE NEXT STEP

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.

Image

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!

Chapter 1

Image
WHY CODING?

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.

Image

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.

Image

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.

Image

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?

Image

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.

Image

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 VS HARDWARE

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!

Image

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.

Image

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.

WHAT COMPUTERS DO

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.