I’ve been working on improving my software development process. I realized that, in order to make sure I’m using the best process for building programs, I needed to answer the question, “What is a computer program?” Once I have that defined, I can make sure my process only includes the things needed to build a program, and nothing more.
Definition of a program
The most appropriate way I could think of to define a program is to define what it does.
After thinking a while, I came up with, “A tool that runs on a computer, and performs tasks with data.” That definition seems to cover every program I’ve ever written.
How would I define, “tool”?
I’d say a tool is anything that amplifies human capability. So, the purpose for writing a program would be to amplify the abilities of its users.
And how would I define, “task”?
Here, I’d say it’s a process with a [defined] start and end.
So, my definition of a computer program is now, “Something that performs precisely-defined processes on data, better than a human can.”
How can I define “better than a human”?
Looking back at the programs I’ve written, the reasons for writing them always seem to be to do tasks faster, or to do tasks more accurately.
Faster can be broken down into two categories – clock time and calendar time.
Clock time is when you’re measuring a specific task, such as totaling up 100 numbers. It might take me a minute or two to do that manually, whereas a computer program would do it almost as quickly as you could enter the numbers. The computer happens to be faster because it has the capability to “think” faster than a human does (at least, in this case).
Calendar time would be for longer-running tasks. In the past, if you wanted to send someone a message, you’d write a letter on paper, take it to the post office, and wait for it to be delivered by the mailman. Nowadays you can write an e-mail and have it appear in your friend’s e-mail box within seconds. Here, the speed improvement is mostly through eliminating waste in the process, not because a program can do a huge number of calculations per second.
I wasn’t sure about including accuracy as a reason. I was wondering if it’s really just another form of speed – in the sense that the task “total up these 100 numbers” implies you’d total them correctly. The computer eliminates the need to double-check your math (for the most part), which gets us back to “faster”.
For now, I’m going to include accuracy.
So, my definition changes to, “Something that accurately performs precisely-defined processes on data, faster than a human can on their own.”
I’m happy with that definition.
Now I need to work on how to use this definition to help write programs.