Just about every electronic gadget you own or use depends on code to work properly. How coding initiates the device to perform as it is supposed to can be confusing but broken down, it’s not as daunting as it appears.
People who make code are called programmers, coders, or developers. They all work with computers to create websites, apps, and even games! Today, our goal is to learn what code is, what it is for, and how it can used in our everyday lives.
What Is Code?
Computers have their own language called Machine Code, which tells them what to do. Since most of us don’t speak “machine,” it doesn’t make a lot of sense to us.
Machine Code consists of numbers or letters, and these are put together in such a way as to tell a computer’s memory to change something. This could also be a number, a word, or even a part of a picture or video. On their own, computers are not so smart; it’s the coding and the programmer’s job to make the computer come alive with whistles, bells, lights, and sound!
It would take most of us a long time to learn Machine Code, but fortunately, communication with computers is made easier; read on.
What Is A Programming Language?
Programming languages perform their duties in the same uniform fashion:
- The code is written telling the computer what to do.
- That code is then compiled into instructions the computer can understand.
- Then the code is executed by the computer.
It can seem confusing with hundreds of various programming languages, but they all serve the same function. Programmers type out the code telling the computer what it wants it to do. The compiler turns it into understandable language, and the computer carries out the command executing the code.
What Is Coding?
Each line of code tells the computer to do something (there could be many lines to ONE task)
A Script is a document full of lines of code. Most programmers use multiple computer languages to write a Script.
Each script is designed to automate a task. This task might change the size of an image or play a certain sound or a bit of music. When a post in social media is “liked” the script is what makes it happen.
Computers are literal. If they are told to start counting and not told a point to stop, they will keep counting forever! Being a good programmer means writing the exact commands for the computer to behave in the desired manner.
What Is A Program?
To produce an easy script that even non-programmers can use, you would need to turn your script into a Program. Scripts alone only carry out commands which are compiled then executed.
Once you are satisfied with your script, you can compile it into a Program. As mentioned, Compiling changes your programming code to machine code, which the computer can understand and execute. In this way, your machine code is stored in a program that anyone can download and use, be it an app, a game, or a website.
How difficult is Coding?
Anyone can learn the basics of coding. Compare coding to books in a library. Some books are easy to read and understand, while others use big words that are complex and generally make no sense to us. But the bottom line is – they are all books.
If you persevere, the complicated language and confusing stories become easier to understand.
Coding works the same. Like anything new, our first attempts are difficult. But with practice, it gets easier and easier. However, if you find it too difficult to learn to program, learning important ideas behind it is still possible using a visual coding language. It is possible to create your own game without typing any code at all.
Images of coding:
To interpret the coding image above: first, we are looking at a script called hello_name. We can see how a single line of code, when executed, can instruct the computer to print a question on the screen.
Suppose instead of simply saying Hello, we want to be greeted and asked our name as well. The coding script can be written to do just that.
Let’s examine the coding script to see exactly what is happening:
- The script starts by printing the question on the computer.
- The computer then awaits the response of the user to input their name and saves it.
- Once the user’s name is input, the script instructs a “Hello” with the user’s name to appear on the screen.
- In the Cmder window, the script compiles and executes using Python. *Note – Cmder is a commander console for Windows, and Python is a programming language used in Script.
- As we can see, the Script ran as designed, then, once finished, exited.
This example shows you a simple piece of code run in Cmder. This is an example of what Python code looks like and how this script works.
How Code Becomes A Program
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. You can most likely guess what happens if you were to click on it!
The example is really simple, and shows how almost all coding works. Programmers, developers, etc. use programming languages every day to write scripts, which will become programs for all to use.
~We now have a broad example of what is being done to create our new CDAP with all the bells and whistles added to construct a user friendly website and atmosphere that will enable us to grow our business with pride!~