some people have what i call “Contemplating owl syndrome”, and the symptoms are really know and easy to be spotted and can be told briefly, making a deep -or the person who has this syndrome thinks it’s a deep- question about a topic which falls in the circle of direct interest of this person, usually the questions start to pop up after 00:00, after end of the routine activities of the day when you have nothing to do or even in the worst cases to evade doing something require mental effort. for sure this is not a scientific or even based on real analysis. which means these people aren’t sick, but maybe they are software developers.
if you’re a software developer and you have these kind of questions, try to write down these questions and search for the answers. in software world, you can make any question and you can find a logical answer for it, since this industry is a completely human knowledge based unlike natural science. computer science is limited by the computations ability that could be described by the proven mathematics theorem. so technical speaking anything related to computers and software can be explained in details, nothing is magical or undiscovered yet, it’s just exist in a book or a paper you didn’t read yet. and one of these questions you can hear from juniors usually is “how the first computer programmed?”. but what a junior doesn’t know as well is that he asked about the foundation of every thing in modern computers and software world.
first known general purpose, programmable and electronic computer called “ENIAC”, and as you can see, it’s a computer can calculate many many things, and it’s not mechanical any more but programmable?! and which language?! it’s programmable but with no programming language in that time, this ENIAC has the nominated architecture in that time when the contents of memory, register and program counter were only : record what the program has done and describe what machine will do. no memory was in this computer to store something so the machine was set-up by a combinations on control panel of sockets to make a calculations at once, and to load another program it was needed to re-wire the computer. yes, restarting!.
ENIAC was put in service at Dec. of 1945, at the same year von neumann one of the mathematicians involved in Manhattan project put his first draft based on Alan turing theories about the concept of stored-programm computers, where he introduced a new architecture according to wikipedia:
- A processing unit that contains an arithmetic logic unit and processor registers
- A control unit that contains an instruction register and program counter
- Memory that stores data and instructions
- External mass storage
- Input and output mechanisms -this stayed as mechanism used in that time just a punch of card with printed dots represents the binary inputs-
the first advantage of this design is the ability if to save instruction “programs in our day terms” in the memory as well as data, which eliminated the need to re-wire the computer every time need to compute different thing, one of the great advantages by design also is self-modifying code, but what interests us today is the capability of treating data as instructions, where a program can produce a program or take a program as input, does it spark something in your mind? if not, it’s ok. von neumann introduced the idea of setting an orders to manage the operations between different units in the new architecture. it seems like “opcode”, right?
in 1949 the first computer to apply what came in von neumann draft was put to the service under the name EDSAC, in this computer “opcodes” were represented by letters, each opcode is a letter, and it provided basic instructions for reading input from tape or printing characters, add, substract, conditional goto and etc.., and since this computer is “automated and electronic” they added a new mechanism -at that time- called initial orders and they were in the low word of memory at the start-up and are hard wired in a set of uniselector switches -can we call it a bios in today terms?-, later the advantage of these initial orders and the stored opcodes resulted in a primitive allocating assembler, and in this context we can define the assembler as a program who take data as input and produce a program -punch of instructions- as output.
but what interests us today is the capability of treating data as instructions, where a program can produce a program or take a program as input.
and that was the first know assembler ever and it had 31 words which later used the codes written on the paper tapes -instead of binary representation- to reproduce the opcodes. even after that programming wasn’t easy as you can imagine, because source code as input still can be seen as dots on paper tapes, for example in that time there was no index register which means if you want to access an array you need to find the memory address through the instruction referencing to it, some problems are still exist with us till today, altering the code and refactoring for example :).
later some programming techniques were invented, like calling subroutine concept, recursive calls and etc.., and in fact, Alan turing discussed for example some concepts like the return address stack in his papers in 1945, such concept allows the recursive calls. for sure i didn’t talk about how physically the memory or another components were look like and how much the hardware production technology impacted the software industry, it’s off topic. maybe i write about it later.
so to conclude this, i would like to point out the nature of computer science that it’s different than other theoretical or practical fields like medicine or astronomy, it’s totally based on what the human brain can imagine, construct and prove. all what you need to improve your self and prepare for the future of the computer science is to trace and understand how it started. i hope these really short words could help you to search how programming started and to sleep well in the night if you’re a “Contemplating owl syndrome” :) but if you couldn’t let it go, welcome in comments to discuss or make things clear about this topic.