system
Given the following post, respond as if you're commenting on Reddit:
human
Why Does Programming Work?

I'm not asking how programming works. I'm well aware of binary and code. I even took a Visual Basic class in college (and got an A).  

What I'm asking is WHY it works. Why does typing in code brig about a certain reaction? Someone obviously didn't just turn on the first computer and start typing shit. Somewhere along the line a standard had to have been put in place. I'm just wondering how that works. 

tl;dr Why does a computer read code the way it does?
gpt
Well little Suzy, inside every computer is something called the central processor. This little guy lives up to his name by acting as the brain of your computer. When you run a program, that program is telling the processor exactly what to do each step of the way.

Inside the processor are a gazillion little switches like light switches that can be turned on and off. These switches all do slightly different things; depending on which switches are turned on and off, the processor will do different things.

Every program is just a list of instructions, each line tells the processor exactly which switches to turn on and off. Some of these switches will cause the computer to remember things (like the number 5, or the word "apple"). Other switches will cause the computer to add two numbers together, or see which of two numbers is bigger.

There are many different types of processors out there, and each kind has different switches inside. This means each one needs to be told what to do in different ways. Some smart people realized this was a problem, so they set out to fix it.

What they realized is they needed to invent a language that humans could easily understand, and that everyone could agree on. A person could write a program just once in an easy language and give it to anyone else that wanted it, and they'd be able to understand it.

Now, there's a problem! We humans could read the instructions in the program, but the poor little processor can't! How did they fix this? Well, they just have to run a special program called a "compiler". This guy is just like the translators you see in movies. They take the instructions and translate them into whatever language the central processor uses, so it can know what to do!

If only learning learning Chinese was as easy!

Non-ELI5: CPUs understand what's called machine code. These instructions are very specific to the CPU. For example, intel processors understand a different set of instructions than arm processors. People used to write out the binary machine code for whatever processor they were working on.

Eventually "assembly" was invented. This is still tied very closely to the processor being used, for example, x86 assembly. This made it easier for humans to understand, but it didn't make code shareable.

What was needed were languages that weren't tied to any one processor. To do this, people joined together and came up with standard languages like BASIC and C.

These standards just describe the language and what it can do. When you write a program in one of these high level languages, you are using its standard rules to tell the processor what to do in a general sense (add, store, compare, etc)

When you are done, you need to run a compiler that knows how to convert between one language, and the machine code specifics of the processor you want to run the program on. There are different compliers for different processors; they all know how to read the standard, agreed upon language, which they then translate into the language of the cpu they are designed for.

I hope that helps!