Program Development


How do you write a program?

You don’t just go sit down at a computer and start hacking out code. It is a three step process.
  • Step 1 – Problem solving In this step you must study the problem carefully to understand exactly what the problem is and what would be a solution to the problem. This is perhaps the most important step in the software development process. If you don't know where you are going how will you know when you get there. Beginning programmers have a tendency to want to hurry to the computer and start writing code before they fully understand what the program is supposed to do to solve the problem.
    This step involved three processes:
    1. Analysis and specification – Understand what the problem is and what the solution must do. This may involve making a list of the requirements for the program.
    2. General solution (algorithm) – Make a list of steps necessary to take to solve the problem. Develop an algorithm.

            Algorithm – A step-by-step procedure for solving a problem in a finite amount of time.

    3. Verify – Go through your solution step by step to see if it really does provide a solution.

  • Step 2 – Implementation - In this step you write the code in the chosen computer language to implement the solution which you have developed.
    1. Concrete solution – Translate your algorithm into code in a programming language.
    2. Test – Run the program and perform tests to verify that it does perform correctly. This may involve adding some extra code to enable you to check what is happening. Too often beginning programmers tend to take the attitude "my program compiles so I'm ready to turn it in." If your program compiles it only means that the syntax of all your computer statements is correct. It does not mean the program will run correctly and accomplish what it should. You must learn to thoroughly test every part of a program.

  • Step 3 – Maintenance In this step you are using the program, but you are also fixing bugs that may be discovered by users, and you are adding new features to the program. After all you want your customers to anxiously await and purchase the "new and improved version" of your software.
    1. Use – Use the program. Well, isn’t that why you wrote it in the first place.
    2. Maintain – Modify the code as needed to fix bugs and to add new features.

What kinds of instructions can be written in a computer language?


Control Structures

There are four types of Control Structures which will be used in programs:
  1. Sequence – a sequential list of actions to be performed.
  2. Conditional – performing some action based on a condition being true or false.
  3. Repetition – doing something over and over. Looping
  4. Subprograms – variously called functions, methods, procedures, or sub-routines depending on the language and who you are talking to.