Updated: Aug 11, 2021
Before you continue reading this article, note that this is not a book of the month; it is a book review. Essentially, that means that there will be both pros and cons so that you know exactly what is in each and every book I review. Enjoy reading!
Coding for Kids by Camilla McCue is a well written book that outlines key coding concepts and introduces coding projects in a simple way for beginners to understand. But, I tend to ask many questions, and I love diving deep into even the most simple topics. That being said, Coding for Kids had a lot of really easy topics, but I wanted more details, and ended up doing my research. I still learned a lot; here is everything I learned from Coding for Kids.
Electronic devices have been a very important part of our lives since they were introduced. Now, we can't even imagine life without them. But, what's even more important is the coding and software in these devices. Today, you will be learning about the basics of coding.
A computer program consists of the instructions you code to make a computer do something. A program like a list of steps, filled with words and symbols. Words in a computer program are called commands, because you're commanding the computer to perform some sort of action. Some of the symbols in a program are +, -, >, <, =, ., and ;. All of these commands and symbols must be organized in a special order to work. You have to put them together and execute the program for it to work properly.
A computer program also has parts such as asking the user for information, doing something with that information, and then producing a result. Within each program, there are small chunks of code that perform different processes. One piece of code that performs a task is called an algorithm. The algorithms that you create connect with each other to build your entire program.
To code a program correctly, you need to plan. There are different ways of organizing and planning a program. Some people like to draw pictures to show how an app, game, or website will run. It's called a storyboard. Other people like to build a flowchart. A flowchart is like a little map with special blocks and arrows that describe the main parts of the program.
Yet another strategy is to jot down ideas in a simplified form of computer code called pseudocode, which means fake code. When you write in pseudocode, you don't have to worry about punctuations such as semicolons or curly brackets so it keeps your mind on the overall idea of the program --- not the fine details. See below for an example:
create variable donuts = 0
if Homer eats donuts
then add one to donuts
if donuts > 10
then print "stop eating donuts!"
else print "have another donut!"
Here are some important skills you should know before you start coding anything.
One important skill is knowing about inputs and outputs [I/O]. An input is something you put into a program, such as your name in a game app. An output is something that comes out of a program, such as a message saying you have reached the top score. Inputs can take a variety of forms such as typing words into an online form, or looking at your iPhone camera so that it's face ID can recognize you. Other inputs include sensors that read information around you such as the temperature of your house, or determining the compass of your car. Outputs can also be in many different forms. These can include text displays, alarms, sensor readings, or automatic activation of those devices.
Simple conditionals are extremely essential in your code, because you can manipulate them to do anything you want. You use conditionals in your daily life every day. For example, you might think, "If it is raining outside, then I'll take an umbrella." The 'if' is called the condition, and the "then" is called the consequence. When the condition is "true," then the consequence(s) is executed. Sometimes the condition is true; sometimes it is false. This type of variable is called a boolean variable. Conditionals allow you and your computer program to make decisions.
Even though simple conditionals are useful, advanced conditionals can improve your program by a lot. Advanced conditionals can take the form of "if-then-else" or "if-else". By using advanced conditionals, you can make sure that there is a specific outcome for every possible state of the condition.
One example of "if-then-else" is "if it is cold outside, then I will wear a jacket, else I will wear a t-shirt." One example of "if-else" is "if it is cold outside, then I will wear a jacket, else I will wear a t-shirt; else if it is less than 90 degrees, I will wear shorts and a t-shirt, else I will wear a swimsuit." As you can see, this allows more options for more possible states of the condition(s).
Another important skill is working with variables, specifically number variables. A number variable is a container that holds a number that can, and will, change. You have the power to create a new variable, and this is called declaring a variable. For example, if you are coding a game with points, that would be a number value, and you would be declaring that variable. You also have the power to create a starting value; it can also be called initializing a value. In your game, the initial value would be '0', and you have to call that out.
Computers store data and there are many different types of data that are used. Data can be called different names such as, values, items, elements, and objects. Some data types are number integer types (0, 1, 2, ...), character types (a, b, ?, !, ...), string types (gr8, apple, pen, ...), logical types (true, false), and date types (2/5/2020, 4/7/2019, 6/12/2021, ...). Different values of data can be assigned to different variables. If there is more than one data type assigned to a variable, it is called a list. If there is only one data type, it is called an array. Even though there are more differences between lists and arrays, this is one of the most basic ones.
Moving on, loops allow you to repeat code in your program. Common commands are the 'repeat', 'forever', and 'repeat until'. Repeat loops allow you to repeat a section of code a certain number of times, while repeat until loops allow you to repeat a section of code until a certain thing happens. Forever loops allow you to repeat a section of code forever (or at least until the code ends). These are the most basic loops, but there are more!
If you have any questions, comments, or corrections, please contact me through the contact section! I want to know what you're thinking!
Coding for Kids Second Edition by Camille McCue