The Programming Process

The procress of creating a program consists the following stages:

  1. Design
  2. Writing Source Code
  3. Compiling
  4. Linking
  5. Debugging

The process goes in cycles. You start with a design, and try to write code to implement that design. As you write the code you may come across problems that send you back to the design stage. Once you have code written you try to compile it. If there are errors or other problems you go back to editing the source code and eventually try again. If your code compiles you try to link it. If that doesn't work you usually have to go back to editing the source code again.

If the code links then you try running it. If it doesn't do what you wanted (if there are bugs that is), or if it just plain doesn't work, then you probably need to go back to the source code again, or you may even need to go back and change the design.

Here's a rough outline of what happens at each step.

Design

Decide what you need the program to do. Try to break the problem down into functional blocks; pieces that you can turn into functions or classes in a programming language. The design process can be further broken down. First there is a basic investigation process, where you try to figure out what needs to be done and how, in theory, it could be done. Secondly you determine the functional blocks of the system and define their interfaces. Thirdly you design the details of interal processing for each functional block.

Writing Source Code

Write a text file (source file or source code) which contains text in the programming language you are using. There should be a file for each class, or each closely related group of functions or classes. There may be one file for each functional block in the design, or the blocks may be split up into smaller pieces. Some parts may even be split off into separate libraries.

Compiling

Take the source code and compile it into object code. Object code is a translation of the instructions you wrote in the programming language into the native language of the computer (basically lots of numbers, also called machine language). Each source file is translated into one object file.

Linking

Link all the object code files for the program together to create an executable. An executable is a file in the native language of the computer arranged so that it can be read from a disk into the computer's memory and executed (or run) from start to finish. If you are using libraries you may have to include those libraries, which are sets of object files archived together for easy access.

Debugging

Almost no programs run perfectly, or even well, the first time they are run. You will have to find out what is wrong with a program and probably go back to the source code to fix the problem. This process is called debugging, and for some programs it never seems to end. Debugging should include testing, which means component testing (each functional block alone), integration testing (combinations of functional blocks and their interfaces) and system testing (the whole system).

After all that the program is finished. Except, of course, that you will always find some new feature you want to implement, or piece of code you want to tweak. At that point you go back to step one and design your modifications, and start into the cycle again.