Programming code tells the computer to do something, but what makes the code actually mean anything to the computer?

1.18K views

Programming code tells the computer to do something, but what makes the code actually mean anything to the computer?

In: Engineering

36 Answers

Anonymous 0 Comments

A computer at the very basic is just a machine with an on/off switch. 1 is the command to turn it on and 0 is the command to turn it off.

Modern computers are a complex assembly of bajillions such machines which can do a lot of different stuff based on the right on/off configuration.

The most direct way for humans to configure computer to do their bidding is by inserting the right string of on/off configuration with a bunch of 1s and 0s. These are what is known as machine language.

But due to the sheer complexity and huge numbers of machines involved in a modern computer, this is not really efficient nor human friendly so we developed a shortcut.

We saved a bunch of frequently used on/off or 0/1 configurations to words we can recognize. So for example 0100110101010 010110010 1010001011 1010111010 can probably be the configuration needed to display a simple apple on the screen based on which pixel should be turned on and which should be turned off.

We are going to need that a lot and we don’t want to waste time typing that long string of 1 and 0s each time so we automate it by saving the whole string as “draw apple”. Nicely short, understandable and easy to remember. This process of translating human words to 0 and 1s is called compiling. So the next time we want an apple displayed, we just type in “draw apple” and the compiler automatically transform it to a bunch of 0 and 1s and set the computer to the desired state.

Overtime we managed to assemble a vast collection of such commands enabling us to do more and more complex configurations by using a relatively short and understandable way. These are the programming code we end up with.

You are viewing 1 out of 36 answers, click here to view all answers.