So, what is computer programming?

Posted 4 years ago | Originally written on 6 Oct 2020

A great understanding is transformational. With it your vision is clear and the vista plain.

Understanding what computer programming is will amplify your effectiveness at it. In this brief post I will outline the essence of computer programming.

A Computer Is A Machine

Computers are machines. In the early days of computing computers were so rare and hard to come by that once one was availed there would often be long queues of users lining up to use the thing. The fact that computers are so readily available all over the world has meant that we have lost the vision of what working with them is all about.

To be precise, computers are computing machines. Even though the early computers were primitive compared to what we have now they were still very efficient at carrying out large computations with easy. Of course the results were only as good as the program. Programs were written on punched cards and it was relatively tedious to 'program' computers. What you were really doing was hiring compute time or run time for your programs to run.

A Program Is A Set of Instructions that Exploit Compute Runtime

Given this background it should now be clear what programming is all about:

exploiting compute runtime to do what you want.

A computer avails a runtime environment and it's up to the user to exploit that runtime to do some useful work.

However, computers and computing have come a long way since those nascent days. Now computers are no longer standalone; they are networked. They no longer run single threads at a time but can run multiple threads on multiple processors at the same time. In all this there is one thing that hasn't changed: the unit of computation is still the process.

A process is an abstraction by which the computer refers to our program. Whether our program is single or multi-threaded; whether it spawns multiple child processes or not it is still a process by which the computer keeps track of our program.

Therefore, it is almost impossible to advance as a programmer without a clear understanding of what a process is, how it works, where it lives, and how the operating system relates to it.

Computing Work Is Done in Processes

Machines are artifices for performing work in a faster and more accurate way. Computers are machines for computing. The word computing is misleading as it implies computations such as addition and multiplications. In reality, computing work involves any activity that involves a clear sequence of steps that advance from beginning to end. In that way almost anything is a computation: reversing a string of characters, displaying an image and good old fashion logical computations. In a word if it can be logically discritised then it can be subject to computation.

All computations live in a process. As mentioned above, the process is the smallest unit of computation. Every process will have access to several system resources: runtime (clock cycles on the CPU) and memory (a place to live). They may also require access to data through storage (disk). Other resource are access to other processes such as pipes and sockets.