Programming is the process of creating a set of instructions that tell a computer how to perform a task. Everything you see on your computer screen, from the graphics in a video game to the text in a word processor, is created by programming.
Programming languages are the languages that we use to write programs and give the computer instructions. For teaching school students coding, they can be broadly categorised into two types: visual programming languages and textual programming languages.
Visual programming languages, like Scratch, use blocks or other graphical elements for programming. They are used for educational purposes, as they allow you to create programs by using graphical code blocks rather than typing out the code.
On the other hand, textual programming languages, like JavaScript, Python, or HTML, require you to write lines of code. These languages are more common in the professional world and can create more complex programs.
Syntax in programming is similar to grammar in a language. It is the set of rules that dictate how programs written in a language must be structured. Just like how sentences in English must have a subject, verb, and object in correct order, a program must also follow certain rules of arrangement.
For example, in many programming languages, commands must end with a semicolon (;). If you forget to include the semicolon, the computer will not understand your command, much like how a sentence without proper punctuation can be confusing.
Every programming language has its own unique syntax, though many share common elements. Understanding syntax is crucial to writing code that the computer can interpret correctly.
Variables in programming are like containers that store data. They hold values that can be changed or manipulated as the program runs.
For example, a variable could be used to store a score in a game, the name of a user, or any other piece of data that the program needs to remember.
An array or list are a type of data structure used to store multiple values of the same type in a single variable. They can be thought of as a list or a collection of items. Arrays are useful when you need to store and manage a group of related values.
For example, in a game we could have an array called "top scores" and this would store the 10 highest scores of the game along with the player's name.