Monthly Archives

August 2013


What is Programming?

August 30, 2013

I just got back from a month trip to Europe. As much as I wanted to stay away from computers and discussing work, I quickly found it is hard to stay away. While I was visiting family, one of the usual questions was what do I do. My normal response is that I am a computer scientist, to which almost everyone in my family responded "what?" with a wired look on their face. I quickly found that if I answer "I program computers" they understand and leave me alone. If you have taken any Computer Science class the first thing you should have been told is that "Computer Science is no more about computers than astronomy is about telescopes". That is true for the most part. Programming is an art, it is a process to create something. Computer Science is all about exploring the options, it is about algorithms, it is about problems and possible solutions. There is nothing in Computer Science that actually requires you to even know programming. One of the key faculty members at my undergraduate university did not have anything o do with programming, he did not have a degree in Computer Science, he did not even have a computer in his office. Yet, he was a Computer Science professor who teaches algorithms. It might be hard to comprehend at first, but the more you learn Computer Science, the more you discover that programming is just a tool. It is nothing but a tool.


Everyone like tools. Tools had been used by humans for a long, long time. We even found animals that use tools to hunt a gather. So what king of tool is programming? It is a computation tool. Much like a very powerful pocket calculator. One can utilize programming to accomplish repetitive or complicated tasks that would have taken a human a long time to complete. For example I could calculate by hand the 100th prime number, or I could use python the find the nth prime number. Both will produce the same number, one will take a split second, the other might take a while longer. This example has much to do with math. There are known formulas and "shortcuts" one could use to find the solution faster, but it is still not a Computer Science problem. It is a very good beginner programming problem.

Now that we have established what a programming problem looks like, let us look at what a Computer Science problem might be. Stable Matching, or Stable Marriage is a problem many algorithm books begin with. You could look at the basic definition of the problem below:

Problem description
Given an equal number of men and women to be paired for marriage, each man ranks all the women in order of his preference and each women ranks all the men in order of her preference.

A stable set of engagements for marriage is one where no man prefers a women over the one he is engaged to, where that other woman also prefers that man over the one she is engaged to. I.e. with consulting marriages, there would be no reason for the engagements between the people to change. -- Rosetta Code

Now, how could we even begin to solve this with programming alone? Programming is nothing by giving the machine mathematical instructions. In the case of the 100th prime number, we can literally count each number and check if it is prime. How could the stable matching problem be solved with programming alone? It can't. In order to solve this problem we need an algorithm. A logical set of instructions that can provide a correct solution to this problem. A computer scientist will sit with this problem and come up with a variety of solutions, with paper and a pencil (or a whiteboard). Once a optimal solution(s) is discovered, it may or may not be actually programmed into a computer, but that is not a requirement. One a solution is found and proved to be both correct and efficient, as a computer scientist my job is done.

Now you may think that given all this Computer Science looks done on programming. I know it may sound like this, but the truth is that with programming there could not be any room for Computer Sceince. The truth is Computer Science fins ways for the future of programming. Computer Science introduces ideas that later are implemented. As a compute scientist, there is no greater joy that programming your solution and seeing the results printed out to you. It is much like Astronomers could do very little without telescopes. After all, there is a limit to what can do in the abstract world of theory, where memory never runs out and the processor is always running.