Code is the instructions a computer needs in order to function. But what does that mean?
An Example of Computer Code in Action: The Microwave Oven
Most of your interactions with code can be thought of as inputs and outputs.
Inputs
When you use a microwave, you trigger a series of actions. You might punch in a cooking duration, then press ‘Start’. Immediately after that, the code running the microwave kicks in and uses your inputs (button presses) to complete the task of cooking.
Outputs
A motor begins to turn the plate inside the microwave. The microwaves are turned on (only if the door is closed!). The timer ticks down and displays that time on the little digital screen. When the time is up, the motor rotating the plate inside the microwave stops. The microwaves turn off. The alarm ‘dings’ to let you know the process is complete.
Code is a Series of Inputs and Outputs….
Imagine what steps it would take to run a basic microwave ‘program’. They might include:
If door opened, turn off microwaves and turn on interior light.
If numbered button is pressed, add that number to the next position on the ‘time remaining to cook’
If door closed and ‘Start’ pressed, turn on microwaves, rotate the turntable, and count down the clock.
When 0:00 is remaining on clock, stop the turntable, turn off the microwaves, sound the ‘alarm.’
When door is opened after time is complete, turn off ‘alarm’ and reset.
Computers can’t read these numbered steps, and really, the steps aren’t strictly numbered. If you open the door during step 3, for example, you want the microwave to stop emitting microwaves!
That’s why coders have to apply different syntax, or styling and punctuation, to code to make it explicit to the computer what to do and how to operate.
.... Specially Styled for Computers to Execute
If you styled Step 1 ( “If door opened, turn off microwaves and turn on interior light”. ) more like code, it might look like this:
if(doorOpen){
microwaves.off();
interiorLight.on();
}
else{
interiorLight.off();
}
This code might look strange, but you can see that it’s just a different way to write Step 1 of the microwave program so that a computer can understand it.
The Endless Possibilities of Coding
Usually you interact with a small set of what code is capable of doing by using an interface, like buttons on your microwave. When you realize that all of the code’s capabilities were determined by another human programmer (or a team of programmers), you can start imagine improvements or customizations you might like!
If you had access to your microwave’s code, you could do things like speed up the rotation of the plate, change the pitch of the alarm ‘ding,’ or add custom timers for your favorite foods.
Why stop there? Looking around your own house, you may also see a coffee maker and a printer; how do you think the inputs, outputs, and code on those devices works?
How Let’s Start Coding Can Help
At Let’s Start Coding, our goal is to help total beginners learn real, typed code in a hands-on way. Our kits include electronics that are controlled with code, so the code becomes very tangible.
We help you start your coding journey with pre-written code examples and in-depth explanations of the concepts you’re learning. Following our step-by-step lessons, you’ll get the basics of code down through trial and error, then customize your own programs and electronics.
If you’re interested in how coding affects the world around you (or you know someone who is), buy a Let’s Start Coding kit and start exploring the wide world of code!
Read More from the blog:
- Is Coding Right For My Child?
- Is A Let's Start Coding Kit the Right Christmas Gift?
- Why A Coding Kit is the Perfect Teen Girl Gift
- Coding for Kids Vs. Adults: What's the Difference?
- 4 Tips to Get Kids Coding in the Summer
- Beyond Blocks: Text-Based Coding in Middle School
- Choosing a First Coding Language (Or Not!)
- Is Coding Really a STEAM (Science, Technology, Engineering, Art, Math) Topic?
- Why is Coding So Hard?
- Why Use Hardware to Learn Coding for Kids?
- What is Coding?
About Let’s Start Coding
Let’s Start Coding builds hands-on kits that teach typed coding for kids. Learners download free desktop software that includes step-by-step projects, code walkthroughs, and challenges. As kids complete challenges, they learn about fundamentals of typed code, like variables, functions, and loops. Most importantly, they're having fun building tangible electronic projects. Kids and parents can use the kits at home with an internet-connected Windows, Mac, or Chromebook computer.