What Is Coding and How Does It Work?

Ian Buckley 05-12-2019

Computer code is very important. Almost every electronic device you use relies on code. The way things work can seem quite confusing, but when you break it down it’s actually simple.


People who make code are called programmers, coders or developers. They all work with computers to create websites, apps, and even games! Today you’ll learn what code it, what it is for, and how to start learning code yourself.

What Is Code?

Machine Code Example

Computers have their own language called Machine Code which tells them what to do. As you can see, it doesn’t make a lot of sense to humans!

Each number or letter is telling the computer to change something in its memory. This could be a number or word, or a little part of a picture or video. By themselves, computers don’t know how to do anything. It is the job of the programmer to give them instructions.

It is possible to learn Machine Code, but it would take a long time! Luckily there is an easier way to communicate with computers.


What Is a Programming Language?

Hello World in Python
Now, this looks a little easier to understand! This picture shows how to tell the computer to say Hello, world. Instead of using machine code, it uses a programming language called Python.

Almost all programming languages work the same way:

  1. You write code to tell it what to do: print(“Hello, world”).
  2. The code is compiled, which turns it into machine code the computer can understand.
  3. The computer executes the code, and writes Hello, world back to us.

There are hundreds of different programming languages which can seem confusing, but they all do the same thing. You type in what you want it to do, the compiler turns it into language the computer understands, then the computer does it, which is called executing the code in programming speak!

What Is Coding?

Sometimes Code is Easy to understand


Coding is the process of using a programming language to get a computer to behave how you want it to. Every line of code tells the computer to do something, and a document full of lines of code is called a script.

Each script is designed to carry out a job. This job might be to take an image and change its size. It might play a certain sound or piece of music. When you click like on someone’s post on social media, a script is what makes it happen.

Unlike people, computers will do exactly what you tell them to. This might sound great, but it can cause problems. If you tell a computer to start counting upwards, and don’t tell it to stop, it’ll keep counting forever! Being a good programmer is all about knowing how to tell a computer to act.

What Is a Program?

Scripts by themselves can only do things if they are compiled and then executed. This is useful while you are still working on it, but when you are done, you want people who aren’t programmers to be able to use your script. What you need is to turn your script into a program.


When you are happy with your script, you can compile it into a program. As you already know, compiling changes the code from your programming language into machine code the computer can understand. This time, the machine code is stored in a program which anyone can download and use. Every kind of app, game, or website is a program.

Is Coding Hard?

Code can be like Books in a Library

Coding can be very simple, and anyone can learn the basics. A good analogy is to think of coding like books in a library. Some books use simple language, and the stories are easy to understand. Others use very complex words and have stories that seem to make no sense. Whether they are simple or hard to read, they are all books.

The more books you read, the better you get at it. The complicated language or confusing stories get easier to understand until one day you can read things that you wouldn’t even dream of in the past!


Learning to code is the same. The first time you try to code you will find it hard, but every time you do it you get better. If you find learning a programming language hard, you can still learn the important ideas behind it using a visual coding language. You can even make your own Mario game Make Your Own Mario Game! Scratch Basics for Kids and Adults Did you know that you can create games even if you don't know programming? Here's a complete guide to getting started on making your first game in Scratch. Read More without typing any code at all!

What Does Code Look Like

Sample Python program

The image above shows a script called hello_name. You’ve already seen that a single line of code can make the computer print to the screen. Let’s say that instead of just saying hello world, you want the user to type in their name, and for the computer to greet them by name? Let’s break down what is happening here.

  1. When the script starts the computer prints a question to the screen.
  2. Next the computer waits for the user to input their name, and saves it.
  3. “Hello” prints to the screen, along with the saved name.
  4. In the Cmder window, the script compiles and executes using Python.
  5. The script ran just the way it was designed to, before exiting.

This example shows you a simple piece of code written in a code editor, and run in Cmder which is a type of terminal window. Don’t worry too much about what either of these things is for now. You now know what Python code looks like and how this script works.

How Code Becomes a Program

Turning a Script into a Program

If you are totally new to code, you might still wonder how scripts like the one above become the kind of programs you are used to using. In the image above, the window on the left is a tool to turn Python scripts into programs. The window on the right has an icon called hello_name.exe. I think you can guess what happens if you were to click on it!

Gif of the working .EXE file

From no code, to a finished program. This example is really simple, but this is how almost all coding works. Every day, people use programming languages they have learned, to write scripts, which will become programs we all use.

Coding Is Cool

Today’s article has taught you what code is, and how some Python code works. There are lots of great websites and apps which can help you learn programming too!

Coding is for everyone, and starting has never been easier. You can even learn to code using Minecraft Minecraft Hour of Code Teaches Kids the Basics of Programming Minecraft Hour of Code provides several excellent tutorials to help kids learn the basics of programming. Read More !

Related topics: Coding Tutorials, Programming.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Kowynn
    December 9, 2019 at 5:46 pm

    This is amazingly awesome you should do more web sights like this

  2. Kowynn
    December 9, 2019 at 5:44 pm

    This is amazingly awesome you should do more web sights

  3. Clifford Precious
    October 21, 2019 at 12:48 am

    Fantastic tutorial, i enjoyed the basic concept of coding here

  4. HildyJ
    March 25, 2019 at 6:00 pm

    Very good article about the technical side of beginning coding but for non-covers, let me offer a description of how to think like a coder.

    Say you have a robot that you can program and you want a glass of wine. Your script will need to define inputs - a bottle of wine and a glass - and outputs - a glass of wine. Then you need to define steps. Get the wine, get the glass, pour the wine into the glass. Oops, let's add open the bottle of wine, something that's obvious to you but not the robot. Also ordering the steps may matter - you can open the wine before you get the glass but you better have gotten the glass before you pour the wine (or you'll have to write a clean up the mess script for your robot).

    Now relax and drink your wine. But the next evening you want two glasses of wine. You could just run the script twice but you could also change the script to go back to the beginning - this is called a loop. And since you might want one glass or two, you can tell the robot when you run the script how many glasses to pour and it will run the loop that many times - this is called user input. But if you just go back to the beginning your stupid robot will get another bottle of wine and another glass and pour it immediately so you need to change your loop to go to the pour step and add if my glass is empty -this is called a conditional statement.

    That's coder thought in a nutshell.