Basic Coding for Kids
For information about Coder Kids classes and camps on a variety of topics, visit register.coderkids.com/onlineclasses.
Learning to code can be an intimidating process to begin. When you think about everything around us that uses coding; smartphones, laptops, computers, gaming systems, video games, TV’s, etc., those are pretty complicated devices! I know for me, if I think of those things first, coding seems like an extremely difficult, highly specific and very detail-oriented skill only a select few adults will ever learn. Granted, coding can be all of those things. But, it can also be much more simple and easy for kids to learn ( Read this blogpost for more info on coding myths). Let’s take a look at Basic Coding for Kids: What they need to learn, How they can learn it, and a Sample Project they can make.
What Kids Need to Learn
These are 6 basic coding fundamentals we think kids need to learn first.
Logic & Decomposition
Logic and decopmosition are pretty closely related coding concepts. They are some of the most basic and foundational coding concepts anyone needs to learn.
Logic refers to the structure and arrangement of a task. For instance, if your task is to code a robot dog to walk from the front door to its water dish, you could code the robot dog to roll around on his back, walk into the backyard, come back inside and then go to his water bowl. However, the most logical (most effective in structure and arrangement), is to code the dog to walk in a straight line to his water dish.
Decomposition is breaking a larger task down into smaller, logical steps. When you are coding, you must tell the computer EVERY SINGLE THING it needs to do. The action might seem obvious or inferred to us, but it is NOT to the computer. The computer can ONLY do what we code it to do. So, if we want to get the dog from the front door to his water bowl, we have to break it down into smaller, logical steps: walk 2 steps forward, quarter turn to the right, 5 steps forwards, half turn to the left, 5 steps forward, stop at water bowl.
Sequencing
Sequencing means the actual order in which the directions are given. For our robot dog, if we give him all the instructions, but in the wrong order, he won’t make it to the water dish. Computers can only do what we tell them to do, in the order we tell them. You need to break down the task into small, logical and properly ordered steps in order to accomplish your goal.
Looping
Looping is a sequence of instructions that happens coninually until a certain condition is reached. It could be a certain number of times the sequence happens, until a location is reached, it touches something else, time limit, etc. For our dog robot, we could use a loop to have the dog keep turning a quarter turn left and taking one step, over and over so that he is walking in a circle. We could have him do that loop until he walked in 3 circles (or whatever number).
Conditionals
Conditional statements tell a program to do different things based on whether a condition is true or false. If you are coding in Scratch, this means coding with if-then statments, or using “when” and “until” statements. For our robot dog, we could code him to sit at his water bowl if it is full. We could also code him to walk to a person if the water dish was empty. Depending on the condition of the water bowl (full or empty in this example), the robot dog will do different things (either sit or walk to a person).
Patience
Patience in coding is the same as patience in any facet of life: the ability to tolerate trouble or difficulty without getting upset or angry. You may be wondering why we’re including patience in our list of basic coding concepts for kids, but it really is a valuable skill for them to learn. Coding (especially in the beginning) involves a lot of trial and error. This can lead to a lot of frustration. When kids learn in the beginning of their coding journey that mistakes and problems are normal, they’ll be able to deal with them in a more productive way. Instead of getting angry and giving up, they’ll be able to slow their thinking, look for problems and think of solutions.
How to Learn the Basics
Now that we know the fundamentals of basic coding for kids, how do we help kids actually learn them? While there are several different methods of learning basic coding concepts, these are some of our favorites. To learn about more about the coding resources we recommend, click here.
Scratch Jr.
Scratch Jr. is a free app/website and is a precursor to Scratch (we’ll talk about Scratch next). Scratch Jr. is designed for kids in grades PreK-1st or 2nd grade. While Scratch Jr. isn’t really great for creating games, it is great for animations and having younder kids learn basic coding concepts.
Scratch Jr. is a block-based coding program, but the coding blocks are labeled with colors and pictures, not words (this makes it accessible to kids who can’t read/haven’t mastered reading yet). Parents will probably need to explain what the blocks do, but the concepts are simple, and once kids have the initial explanation, they’ll be good to go explore and create. Click here for 7 awesome Scratch Jr. projects.
Scratch
Scratch is also a free app/ website. It was designed by MIT to help kids learn how to code. Scratch is also a block based coding language, but the blocks are identified and customized with writing and words. It teachers beginners the fundamentals of coding so that they can move on to more advanced programming languages.
Although Scratch is designed for beginners, you can make a wide variety of projects, from simple animations to complicated games and interactive animations. Scratch is easy to grasp, with or without additional books, help or typing. There are tons of books and tutorials out there, but your child won’t necessarily need them create cool stuff with Scratch. One of the features I really like on Scratch is that you can “see inside” other people’s projects. That way you can see how they coded their games or animations, and it can help you do even more.
Lightbot and LightbotJr
Lightbot and Lightbot Jr are apps you can get for your phone or tablet that help to develop fundamental coding skills in a fun way. Each version costs about $3. We usually have younger kids start with Lightbot Jr (ages 4 and up), and then move onto Lightbot when they are ready.
In Lightbot and LightbotJr., you are programming a tiny robot to complet different functions, like walking, turning, jumping, lighting up boxes, etc. The Lightbot apps are a wonderful way for kids to learn the basics of logic and sequencing in coding. Some of the levels on Lightbot are difficult even for adults!
Code.org
Code.org is a free website that helps kids learn basic coding. Kids sign up and get their own accounts and then work through the program. Code.org starts with simply dragging and snapping code blocks together and then moves on to sequencing. After that, the lessons move towards more challenging subjects. What’s great about Code.org, is that the lessons are already set up with instructions and ideas. However, the projects do get difficult pretty quickly, so they made need some grown up help!
Coder Kids Online/In Person Classes and Private Lessons
Another great way for kids to learn basic coding is with Coder Kids. Coder Kids offers online and in person classes and private/small group lessons. They have classes for beginners to advanced students, from grades PreK through 12. For grades PreK-2, kids learn basic coding fundamentals. For grades 3-6, they offer Scratch classes that teach kids how to code their own games and animations! They also offer introductory and advanced classes in other coding languages, like python, JavaScript, C++, etc.
Sample Project
Let’s take a look at a great basic coding project for kids from Scratch. If you’re looking for some other basic coding projects for Scratch Jr, check out this blogpost (it has 7 projects for you to try!).
Animate a Name
This is a great project for beginner coders. You can watch the video tutorial from Scratch here.
Here are the basic steps:
1. Delete the scratch cat sprite.
This is pretty straight-forward. Just click on the little “x” in the garbage can next to the cat sprite
2. Add the letters of your name as sprites.
To add a sprite, click on the cat head with a plus sign towards the bottom right corner. Once you do that, click on “letters” (top right). Then click on the first letter of your name. Continue this process until you have added all the letters of your name.
You may also want to move you letters so they are spaced in a different way. Just click on the letter and drag it to where you want it to start.
3. Add events to make each letter do something different.
This is where things get exciting, and we start to code! You can be totally creative here! I’ll give you some examples, but be sure to explore all the options!
First, I’ll code the “S” to change colors.
Click on the small letter below the stage so that you are coding for the correct letter. To start out, I’ll need to use the yellow-orange block that says “ when (picture of a green flag) clicked". This is a really important coding block becuase it tells my project when to start doing stuff. I’ll drag that block to the coding area.
Then I’ll click on the “looks” circle (purple) and find the “change color by 25” block. I’ll drag that over and click in underneath the green flag block. Click the green flag and watch the color change! (press the stop sign to reset the project).
I’m also going to add a “wait __ seconds” and a “repeat __ times” blocks to my letter S. This way, when the green flag is clicked, the color will change 10 times!
Now I’ll make the “A” spin!
To start, I’ll click on the “A” so that I’m coding for the correct sprite.
Then I’ll add the “when (green flag) clicked block. To make it spin, I’ll add the “move __ degrees block” (it’s a blue block in the Motion section). I changed the degrees to 90 so that it will be easier to have it spin all the way around.
Then I’m going to add the “repeat __ times” block. I’ll have it repeat 4 times so that i get one full rotation!
How to make the “R” pop with sound!
Now I’ll click on the “R” to start coding it.
I’m going to add the “when this sprite clicked” block.
Then I’ll add some sound! I’ll drag the “play sound pop until done” block over. Now when you click the “R” it makes a pop sound!
Making the “A” grow and shrink.
I’ll work on the second “A” now. I’m going to make it change sizes. Be sure to click on the letter so you’re coding the right one!
Now I’ll add the “when (green flag) clicked” block. Then I’ll go to the “Looks” section and drag the “change size by__” block.
I’m going to add the “wait __ seconds” block under that. I’ll edit the time so that it waits 0.25 seconds.
I’ll add another “change size by__” block and edit it to -10.
After that, I’m going to add the “repeat __ times” block around them so that my “A” changes sizes a bunch of times!
Make the “H” Disappear!
First, I’ll click on the “H.”
Then I’m going to add the “when (green flag) clicked” block.
Under that I’ll add the “change color by __” block. I’m going to click on color to the drop-down menu and select “ghost.” And change the number effect to 25.
Then I’ll add a “wait __ seconds” block. For this I’m going to choose 0.25 seconds.
And last, I’ll add the “repeat __ times” block. I’m going to choose 4 times so that the “H” will completely disappear (since I’m changing it by 25 each time, if it happens 4 times, then it will be 100% ghost).
4. Add a cool background!
To add a background, click on the “backdrops” button in the bottom right corner. This will take you to all of the backdrops Scratch has for you. Just click on the one you like, and it’ll be there!
Of course, you should play around on Scratch and explore all the cool things you can do with this project, not just what we did in the examples. If you can think of it, there’s a way to do it! Trying out new things is how you learn and develop your skills from basic to advanced!
Conclusion
We hope this has given you a good overview of Basic Coding for Kids! There are a lot of resources out there to help kids learn how to code. You can use free online sources, pay for books, apps, programs, or join a class or have lessons. Whatever option you choose, remember that learning the basics of coding first is really important. Once you learn those, you can keep creating and improving your skills!
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.