"How is this code talking to the computer?"
Like Magic, typing code into the box and clicking the button 'Check My Code' causes the computer to do something.
But, how is the code actually being understood by the computer? Computers speak a language called "Binary".
Human Languages of the world contain letters (aka symbols) like 'A', 'β;', and 'ಓ'. The symbols for a language is called its 'alphabet'.
Computers have a very small alphabet with only two symbols, '0' and '1'. Computers like this since it is easy to understand '0' (off) or '1' (on). This comes from how computers keep track of information.
Like a light switch, you would turn it on for light, and off for no light. Inside computers are many (millions, billions, trillions) such light switches. It can turn each switch on/off as it needs. Within the computer are tables defining what number of lights on/off mean something else.
Let's pretend the computer had a table for letters 'A', 'B' and 'C'. The table could be like:
Now that you know what language the computer speaks, you can see how trying to communicate with them in their language would be very difficult. You would be flipping thousands of light switches just to say "Good Morning" to the computer.
Luckily, another language was created to help with speaking the 'Binary' computer language. This next level of language is called the 'Machine Codes'. Unfortunately, this language is so close to Binary that it only used numbers. An example phrase in the 'Machine Code' language looks like:
The computer can understand the 'Machine Code' language as well and will convert it to the 'Binary' language. The 'Machine' phrase above would end up being the 'Binary' phrase below:
00011101 00001000 00110111 00110011 00100111
Though there are some 'hardcore' coders who actually do some work at the 'Machine Code' level (my hats off to you!), this still isn't friendly enough to easily program in.
- 29 = 00011101
- 8 = 00001000
- 55 = 00110111
- 51 = 00110011
- 39 = 00100111
Another level of language was created called the 'Assembly Language'. This language started getting closer to what humans can read, since it doesn't contain only numbers. Here are a couple lines of 'Assembly':
Pretty unfriendly looking, no? Programs called 'Assemblers' can take the 'Assembly' language above and convert it into the 'Machine Language', which is then translated by the computer into 'Binary'.
Hopefully, after seeing 'Binary', 'Machine' and now 'Assembly' you are saying "What? This is crazy talk!" If so, I'm with you!...As are most programmers.