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.