Cover: Getting Started with Coding, 2nd Edition by Camille McCue

Title Page

Getting Started with Coding

INTRODUCTION

SO YOU WANT TO GET STARTED WITH CODING! Writing computer programs, or coding, is a skill that will take you from a user of technology to a maker of technology. Coding is a skill that is fun, creative, and productive. By discovering the language of the computer, you become capable of inventing toys, games, and apps that you can share with, well … everyone!

ABOUT THIS BOOK

You can use many computer languages to get started with coding. What you find in this book is an introduction to the big ideas and practices of coding, using two coding languages: Scratch and JavaScript block format, via MakeCode. You can learn more about both languages in the next section, “What’s New in the Second Edition.” The skills you build by coding projects in this book can be used in every other programming language.

Getting Started with Coding, 2nd Edition is put together as a series of projects and related big ideas in coding. Each project is presented as steps for constructing both graphic design and code, start to finish. The big ideas connect a project with the skills you’ll perform over and over again when coding. Best of all, projects can be customized to bring to life the craziest ideas your imagination can concoct!

Here's what you need to do the projects in this book:

  • A computer with a relatively modern version of a web browser (Safari, Chrome, or Firefox), or a tablet running Mobile Safari or Mobile Chrome. (Note that Internet Explorer is not supported.)
  • An Internet connection.
  • (Optional) A USB port on your computer and a micro:bit kit for transferring the electronics programs in this book to a physical board. A complete micro:bit kit retails for less than $20.

As you work through each project, keep in mind the following writing conventions:

  • Code and web addresses are in monofont. If you're reading this as an ebook, you can click web addresses, like www.dummies.com, to visit that website.
  • The highlighted text draws your attention to the figures.
  • For each project, I give you step-by-step instructions. Instructions read “Drag an X into the Y” or “Click the X category and then click Y.” Or I may simply tell you to click a link or a tab. Follow the instructions in order.
  • Optional enhancements are given in each project so that you can customize your work to showcase your own creative ideas!
  • Finally, every project wraps up with a last look at the project’s big ideas in coding. The big ideas consist of concepts that lay the foundation for your future work in computer science.

That’s all there is to it!

WHAT’S NEW IN THE SECOND EDITION

This second edition reflects recent trends in programming instruction. Specifically, this book uses programming languages that start you down the path of learning basic coding skills you can apply over and over as you learn more.

This edition of the book covers:

  • Scratch: This learning language developed at MIT is so popular that it is arguably “the” starter programming language. As such, this book features several projects in the most recent version of Scratch — Scratch 3.0. (But for those of you who may be running an older, offline version of Scratch, you’ll still be able to do most projects.) Scratch is a block-based language that lets new coders comfortably step into the world of computer programming. And it’s fun!
  • JavaScript: JavaScript is used in everything from apps to websites to electronics. Kids can begin learning in block-based mode of JavaScript, and then transition to text-based mode as they build skills and confidence in coding. In this book, JavaScript projects are presented through MakeCode, a platform for coding instructions that can operate a small electronics board called a micro:bit.

Best of all, the tools in this edition are free, available online, and easy-to-use.

ABOUT YOU

Everyone has to start somewhere, right? I had to start writing this book by assuming that you can do this stuff:

  • Type on a computer and use a mouse (if you’re working on a computer) or use a touch screen tablet (if you’re working on a tablet). Your experience can be on Windows or Mac — or Android or iOS. Because Scratch and MakeCode run in a web browser, the instructions in this book are platform-independent. Figures show the programs as they would appear in Chrome on a Mac.
  • Read or read with the help of someone who reads, as well as follow directions with help from the text and the figures.
  • Do some basic math operations such as adding or comparing numbers. I introduce algebraic variables in this book, but you don’t need to have any prior knowledge of variables.

Lastly, if you struggle with spelling and punctuation, you may need to spend extra time troubleshooting your code for misspellings. Block-based programming greatly reduces these types of errors, or bugs, and programming languages can give you clues about which commands they don’t understand. But you will need to pay extra attention to the details, making certain that commands are written exactly as you intend.

ABOUT THE ICONS

As you read through the projects in this book, you’ll see a few icons. The icons point out different things:

Warning Watch out! This icon marks important information that you can use to avoid common pitfalls when coding.

Remember The Remember icon marks concepts you’ve encountered before and should keep in mind while coding.

Tip The Tip icon marks advice and shortcuts to make your work easier. You may see some tips several times in the book

Technical stuff The Technical Stuff icon give hardware help and tells you more about the nuts and bolts of technical details.

Fun with code The Fun with Code icon describes how the coding you’re doing relates to the bigger picture of computer programming.

Fun with math The Fun with Math icon describes the everyday math you use while coding computer programs. Finally, you see how that stuff is really used!