Teach Your Kids to Code: A Parent-Friendly Guide to Python Programming
Everyone can learn to code it’s just like solving a puzzle or a riddle You apply logic try a solution experiment a little more and then solve the problem The time to start learning to code is now We are at an unprecedented time in history never before could bil lions of people connect with one another every day like we do now with computers We live in a world of many new possibilities from electric cars and robot caregivers to drones that deliver packages and even pizza If your children start learning to code today they can help define this fast-changing world Why should Kids Learn to Code There are many great reasons to learn computer programming but here are my top two Coding is fun Coding is a valuable job skill Coding Is fun Technology is becoming a part of everyday life Every company charitable organization and cause can benefit from technology There are apps to help you buy give join play volunteer connect share just about anything you can imagine Have your children wanted to build their own level for their favorite video game Coders do that What about create their own phone app They can bring that idea to life by programming it on a computer Every program game system or app they’ve ever seen was coded using the same programming building blocks they’ll learn in this book When kids program they take an active role in technology they’re not just having fun they’re making something fun Coding Is a Valuable Job skill Coding is the skill of the 21st century Jobs today require more problem-solving ability than ever before and more and more careers involve technology as an integral requirement The US Bureau of Labor Statistics predicts that more than 8 million technology jobs will be created in just the next five years Seven of the ten fastest-growing occupations in the xxii Introduction
2014 2015 Occupational Outlook Handbook that do not require master’s or doctoral degrees are in the computer science or infor mation technology IT fields Mark Zuckerberg was a college student working from his dorm room when he developed the first version of Facebook in 2004 Just 10 years later 1 39 billion people were using Facebook every month source http newsroom fb com company-info Never before in history had an idea product or service been able to engage a billion people in under a decade Facebook demonstrates the power of tech nology to reach more people faster than ever before Where Can Kids Learn to Code This book is only the beginning There are more places than ever to learn programming websites like Code org Codecademy see Figure 1 and countless others teach basic to advanced program ming in a variety of in-demand programming languages Once you’ve completed this book with your kids your children can take free courses through websites like EdX Udacity and Coursera to extend their learning even further Figure 1 Codecademy teaches you how to program step by step in a variety of languages Coding clubs are a great way to have fun learning with friends Getting a college degree in a relevant field is still one of the best ways to prepare for a career but even if college isn’t an option at the moment your kids can begin building a program ming portfolio and demonstrating their skills as a programmer and problem-solver today What Is Coding and Why Is It Good for Your Kids xxiii
how to use this Book This book isn’t just for kids it’s for parents teachers students and adults who want to understand the basics of computer pro gramming both to have fun and to gain access to new jobs in the high-tech economy No matter what your age you can have a great time learning the basics of programming The best way to do this is to experiment and work together Explore Learning to program is exciting if you’re willing to try new things As you and your kids follow along with the programs in this book try changing numbers and text in the code to see what happens to the program Even if you break it you’ll learn something new by fixing it In the worst case all you have to do is retype the example from the book or open the last saved version that worked The point of learning to code is to try something new learn a new skill and solve problems in a new way Make sure your kids are playing around testing their code by changing something saving the pro gram running it seeing what happens and fixing any errors The point of learning to code is to try something new learn a new skill and solve problems in a new way Test your code by changing something saving the program running it seeing what happens and fixing errors if needed For example I wrote some code to make a colorful drawing Figure 2 and then went back changed some numbers here and there and tried running the program again This gave me another drawing that was completely different but just as amazing I went back again changed some other numbers and got yet another beau tiful unique drawing See what you can do just by playing around Figure 2 Three colorful spiral drawings I created by trying different values in a line of code in one program xxiv Introduction
do It together Experimenting with code is a great way to learn how programs work and it’s even more effective if you work with someone else Whether you’re teaching a child or student or studying for yourself it’s not just more fun to play with code together it’s also more effective For example in the Suzuki Method of music instruction par ents attend lessons with their child and even study ahead so they can help their child between lessons Starting early is another hallmark of the Suzuki Method kids can start formal study by the age of three or four I began introducing my two sons to programming when they were two and four and I encouraged them to have fun by changing small parts of each program like the colors shapes and sizes of shapes I learned to program at the age of 13 by typing program examples from books and then modifying them to make them do something new Now in the computer science courses I teach I often give students a program and encourage them to play around with the code to build something new If you’re using this book to teach yourself you can work with others by finding a friend to work through examples with you or by starting an after-school or community coding club see http coderdojo com or http www codecademy com afterschool for ideas and tips Coding is a team sport online resources All the program files for this book are available at http www nostarch com teachkids as well as sample solutions for the Programming Challenges and other informa tion Download the programs and experiment with them to learn even more Use the sample solutions if you get stumped Check it out What Is Coding and Why Is It Good for Your Kids xxv