Computers, phones and robots all run off this mysterious thing called ‘code’. Without it, there would be no way Siri could tell us that she’s having problems understanding us, and our video game consoles wouldn’t even turn on (devastating). The coffee-devouring geeks swear by it, but what is code, and what does it do?
Computers don’t speak English
There’s one big problem with sending computers instructions – they don’t speak English. Or any other human language, for that matter. Computers communicate with each other and us (well, they try to) in what’s called binary, a bunch of zeros and ones. To be able to control them and tell them what to do, we had to make a language that both humans and computers can understand. That language is code.
Code is a sort of in-between language that allows us humans to communicate with our machines. Instead of confusing ourselves with binary, we can use normal English in a special way to send and receive information.
In simplest forms, it’s a set of instructions we can send to a computer or device to tell it what to do. You can think of it as a long list of chores that the computer has to obey. It’s code that makes all of our electronic devices so smart – with it, we can use information from sensors or apps to make decisions. For example, code is used to tell heaters to turn on when it gets below a certain temperature, keeping us toasty in winter.
However, once the code is written in English, it still has to be turned into binary for the computer to be able to understand it. That’s why we use something called a ‘compiler’, a program that takes the code you’ve written and turns it into a form that computers can understand.
Just how many languages did you say?
In fact, there’s over 500 different programming languages in use at the moment (confusing, eh). What’s the difference? A lot, actually. Each programming language has a different way of setting out instructions and has its own set of rules that you have to abide by. So while you can do the same sorts of things across different programming languages, the way you do them is different. It’s like our languages – different words can make the same meaning across different languages.