ELI5 how did Ada Lovelace invent "the first code" before computers existed?
eli5 how did Ada Lovelace invent "the first computer code" before computers existed?
There are two things that explain why a program can exist before a computer does.

Firstly, all computers can do anything that any other computers can do. Of course, it's not always 100% in practice, but what we usualy call a "computer" really can. It's called being "Turing-complete", and suprisingly doesn't require much. You computer can be able to do only two, or even just ONE operation, many times, and have somewhere to record it — and then it could still accomplish anything that any computer can do.

The only difference is how FAST it does it. If you can only add numbers (this is the operation) and write down the result (this is the memory), with some additional rules for how you do it, and you do it with pen and paper, you can run Crysis — only it'll take longer than the age of the Universe. But you can.

Secondly, this means that a computer can exist without transistors, circuits, and electricity. It can be imagined. This imagined computer then does a series of math operations. You can invent a sequence of operations that should give you the desired result, and write it down. You now have a "computer program" without having a computer.

Then, suppose real, electronic computers came around. We look at the "paper" program, look at our real computer's instructions (operations it can do, basically "commands"). We adapt the "paper" program to our real computer, and we can run it. Now we can run Ada Lovelace's program on a real computer.

For a long time, that's how real programmers worked, too. They knew what their computer could do (its language of commands). Then, they imagined the program and wrote it down in a notebook. Then they fed the program to the computer by pressing buttons or using punch cards. Only then did the program first run inside the computer.
