ELI5: How did the first programmers program programs? For example, how did they program the Operating System or CMD if they had no programs or programming languages.

This answer is going to require some backstory to make sense.

Way back when, during the infancy of programming, programmers used what's called Machine Language, or 1's and 0's. Nearly everyone recognizes Binary, but few people understand how it works, and for good reason. It was slow, clunky, and very weak, computers made directly with machine language couldn't do much, and the original operating systems weren't capable of very much. Machine Language is also ridiculously hard and inefficient for humans to understand. This is how computers were directly used and programmed. However, as we learned more about logic, computers, and the potential of the confluence thereof and from the simple manipulation of 1's and 0's, we learned more and more about the language of computers, and how we could manipulate that.

All computers speak in Binary, or Machine Language, in every single thing they do, from the IP address to your computer (192.168.1.1 = 11000000 10101000 00000001 00000001) to the routers and switches you communicate with to the graphics you see on your computer to the letters you type, everything is done in Binary. And Binary is referred to as a Base 2 system, as there are Two numbers: 1 and 0. On or Off, quite literally. The system we use to count every day is a Base 10 system. There's 1, 2, 3, 4, 5, 6, 7, 8, 9, and 0. However, this was, as previously mentioned, slow, clunky, and inefficient to get a computer to actually do anything. To make this easier, we learned how to translate Binary into Hexadecimal, or Base-16 which translates binary into even more numbers. In this case, the 1's and 0's are translated into 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. It's still the same thing, but shorthanded. (Fun fact, the 24 hour clock we use every day is a Base 24 system)

But in the development of that, we learned we could do even more with the translation of machine language. We started adding layers of translation from machine language into entire scripting sentences, but we needed some way to translate all of that automatically. We needed some way to procedurally translate and manipulate the script we were editing to turn into logical action on the computers part, on the Binary level. Enter the Compiler.

Most every language you know, from Python to C++ to Ruby to anything in between, is what's referred to as a High Level Language, as it sits on a logical level far away from the Hardware. Binary is a Low Level Language, as this sits very close to the Hardware of the computer itself. The high level language doesn't actually do anything to the computer on its own, and requires the use of what's called a Compiler to actually do anything. The Compiler acts like a translator, turning the language you put into it, into an executable file. This executable file, in turn, manipulates the computer into doing what you want it to do on the machine level language, manipulating 1's and 0's based on the script you plug into it. This is what allows complex programs, firmware, and operating systems.

/r/explainlikeimfive Thread