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

At it’s heart you can think of a computer like a programmable calculator. It can add, subtract, tell if two numbers are the same, bigger, or smaller, and do different calculations depending on the result (if bigger, do A, if smaller do B, and the calculations continue). More complicated operations can be done based on these simple ones. We humans have devised ways of describing behavior, and translating into those calculations. This is basically a programming language.

It would be tough for a five year old, but not impossible to just read one of these instructions for the computer, and figure out what it does. Some of them are pretty much the same as you’d see in code. “C = A + B”, could be “add A, B, C”, where A is the result, B and C are the values to add. This is then turned into a number that the computer understands.

How the computer understands this number isn’t exactly easy for me to explain. It’s quite complicated, even though the math is often very easy. The principle isn’t that different from previously described though. We’ve figured out how to use electricity to do basic math. That number I mentioned is turned into the math. I’m too tired to explain from there, but that’s essentially how it works.

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