There’s something I enjoy about finding bugs in a program. The methodical search for the imperfect delights me, and whenever I find a bug my mind usually works on several possibilities at once. As a general rule of thumb, when I see my program behaving strangely, in two ways that seem totally unconnected, it’s a good posibility that they are linked directly. There’s something very intellectually pleasing about two unconnected phenomena that are actually directly related.
On that note, I beleive that computer science and programming are the purest of all sciences, and that programmers make the best scientists. The reason for this is simple; science is all about the scientific method. First, some sort of phenomenon is observed. In an attempt to explain the phenomenon, a model is constructed or an explanation given for the phenomenon. In order for the model to prove usefull at all, it has to be tested. If the model withstands testing and results are produced succesfully from that model, it’s accepted as ‘true’ or ‘valid’ or whatever you please. If it doesn’t produce usefull or valid results, it’s rejected and a new idea is sought out.
Finding bugs in a software program is science on a small scale. You observe a bug. You construct a mental model of your program in order to determine what caused it to err. Once you have constructed a model and explained why the software is doing what it’s doing, you test your hypothesis by looking for and fixing the fault. If you run the program and it works, good. If not, you revisit your mental model and attempt to correct it in order to have it predict the bug that you’re observing.
Another thing that I should think would make good programmers into good scientists is the nature of the debbugging proces – I’m not sure how others work, but for me the key to understanding why a bug is happening is to insert all kinds of output statements in my program, so it tells me exactly what it’s doing. This is akin to constructing an experiment and gathering all of the necessary data. With a computer the only data you can’t collect is that which you don’t understand.
On a final note, the biggest difference between computer science and the rest of scientific endeavors is how easy it is to ‘jump in and get going’. If someone tells you that an object is made of up atoms, you can’t bust it up and count the atoms. You can’t take it apart and put in different atoms to see how it works. You can’t even look real close and see the atoms – all you can do is take his word for it, and beleive him when he shows you pictures of some little bumps. With computer science, that isn’t the case at all. If someone tells you that this sorting algorithm runs in this time, you can easily implement the algorithm yourself and see how fast it runs. If someone tells you that acecss times for heaps are on the order of log(n), you can check it out for yourself. True, there are some things like parrellel computing and such that you can’t really do unless you have the equipment, but for the most part all you need to do computer science is a pencil and paper. Sure, a computer helps, but it’s not really even necessary. Most of the time you can even do it in your head.
I could go on, but I’m going to get back to programming.