What is involved in writing a computer program? What kinds of decisions must be made? Who is involved? Is it hard? (I'll bet you can guess the answer to that last one!)
The process of creating a computer program is not as straight-forward as you might think. It involves a lot of thinking, experimenting, testing, and rewriting to achieve a high-quality product. Let's break down the process to give you an idea of what goes on.
What Task?
The first decision to make when creating a computer program is: What is this program supposed to do?
The more detailed this description is, the easier it will be to get good results.
What Language?
The choice of what computer language to use has important consequences for how easy the program will be to write and maintain. The graphic shows some of the most commonly used languages and what tasks they are usually used for.
The languages are grouped by how complex they are for the writer. The simplest with the least power are at the bottom. Simple languages for simple tasks. (But how simple is any of this, really??)
Things to consider in choosing a language
Works with what you've got -
Existing standards in your company
Existing hardware
Existing software with which to interact
Programmers' current knowledge
Will work in the future -
With variety of hardware
Changes easy to make in programs
Errors easy to find in programs
Who's Involved?
What people are involved in the creation of a new computer program?
The End User sets the tasks to be done. What does the customer want to do??
A Systems Analyst designs the overall requirements and sets the strategy for the program.
A Programmer writes the actual code to perform the tasks.
There may be a huge team of dozens of people involved. Or perhaps one programmer decides that he can write a program that is the answer to what users complain about. It may be done in a highly structured series of conferences and consumer surveys. Or perhaps someone is listening to what people say as they go about trying to work. Somehow the needs of the end users must be understood as well as the limitations of the code and the hardware. Costs come into play, too. (Sad but true.)
All of these people must communicate back and forth throughout the process. No program of any size will be without unexpected problems. So it's test and fix and test again until the program actually does what it was intended to do.
Program Development
A program goes through the following steps over and over during its development, never just once.
1. Set & Review goals: What is it supposed to do?
2. Design: Create the strategy to achieve goal.
3. Coding: Write the program.
4. Testing: Try it out with real people.
5. Documentation: What you did and why. How to use it.
One of the techniques used during the design phase is to flowchart the program, as on the right. Different shapes represent different kinds of steps, like input and output, decisions, calculations. Such charts help keep the logic clear, especially in complex programs.
Each time through the development loop, the program must be debugged. This means testing the program under all conditions in order to find the problems so they can be handled. There will always be problems. Sometimes it's just a typo, and sometimes it's a flaw in the logic, and sometimes it's an incompatibility with the hardware or other software. Handling such situations can be the most time-consuming part of the whole process!
Proper documentation can make or break a program. This includes explanations to the end user of how to use the program and also internal notes to programmers about what the code is doing and why. It is amazing how quickly the original coder can forget why he wrote the code that way!
Programs often need to be maintained, that is, changes must be made. For example, the sales tax rate might change or zip codes may get more digits. With proper internal documentation, a different programmer can make these adjustments without damaging the program.