Definition of Programming
Total Page:16
File Type:pdf, Size:1020Kb
Definition of Programming
Programming is the activity of:
Analyzing a problem to be solved
Preparing a design for the steps in a set of instruction (an algorithm) that together with the data, will solve the problem.
Expressing the algorithm in a language that the computer can ultimately execute
Ensuring that there is adequate documentation so that other people and not just the original programmer, can understand the computer program.
Testing and validating the program to ensure that it will give correct results for the full range of data that it is to process
Maintaining the program over time so that any changes that are needed are incorporated.
A program is a collection of instructions that directs the computer to perform a specific task.
Programmers are individuals who write these programs in a language the computer can understand.
Programmers have the ability to:
Solve problems Organize information Design solutions Express instructions in a logical sequence Input them into a computer
Problem solving is the process of breaking problems down into smaller more manageable parts. As the large problem is broken down into smaller parts, each part becomes more specific. These individual solutions to smaller problems are then combined to solve the larger problem.
One method is the problem-solving approach to writing programs to help ensure that the program will perform the desired task when it is finished. There are three steps:
The first step a programmer must do when writing a program is to determine exactly what the output should be.
The second step is to identify the data, or input, necessary to obtain the output.
And the third step is to determine how to process the input to obtain the desired output.
001_Definition of Programming Examples: Recipe Building a bridge Word Problems
How fast is a car traveling if it goes 50 miles in 2 hours?
Step One: The output should be a number giving the rate of speed in miles per hour.
Step Two: The input needed is the distance and the time the car has traveled.
Step Three: The process is using the formula rate = distance / time
A second method is the problem-solving model. There are six steps to this method which is used when the solution to a problem is not as obvious as the example given above.
1) Identify the Problem a) What is the current situation/problem? b) What is the problem to be solved?
2) Analyse the Problem a) What do we know already about the situation/problem? b) What are our assumptions? c) What is the knowledge base of the person for whom we’re trying to problem/solve? What can or do they understand? d) What don’t we know yet about the whole situation/problem?
3) Brainstorm Ideas a) List all possible ideas to solve the problem. b) No value judgement is to be passed on any suggestions. c) The more ideas, the better.
4) Prioritize Ideas a) Establish pros and cons of each suggestion in step 3. b) Rank the suggested ideas from step 3 according to set criteria.
5) List the steps to be taken following the chosen solution. a) What are the steps/instructions we should take according to the top solution ranked in step 4? b) Will these steps/instructions be understood according to the knowledge base established in step 2?
6) Evaluate/test the solution. a) Do we have the desired results after following the steps in step 5? b) Does the solution satisfy the needs of the person with the problem? c) What are some of the areas that are not correct/satisfactory? (back to step 1)
001_Definition of Programming Diagram of the Problem-Solving Model
Identify the Problem
Evaluate Solution Analyse the Problem
List Steps/Instructions Brainstorm Ideas
Prioritize Ideas
This leads to the program development cycle. This step-by-step process enables programmers to use their time more efficiently and helps to design error-free logic for their programs.
1. Analyze: Define the problem using the three step problem-solving approach or the six step problem-solving model. You must have a clear idea of what data (or input) are given and the relationship between the input and the desired output.
2. Design: Plan the solution to the problem. Find a logical sequence of precise steps that solve the problem. Such a sequence of steps is called an algorithm. Every detail, including obvious steps, should appear in the algorithm. Flowcharts, pseudocode and top-down charts are three methods that are used to help break a problem into a sequence of small tasks the computer can perform to solve the problem. Sample data should also be used to test the logic of the algorithm by hand to help ensure that it is correct.
3. Code: Translate the algorithm into a programming language.
4. Test and debug: Locate and remove any errors in the program. Testing is the process of finding errors in the program, both coding errors and logic errors. Debugging is the process of correcting errors that are found.
5. Maintenance: Documentation is intended to allow another person, or the programmer at a later date, to understand the program. Documentation can be either internal or external. Internal documentation consists of statements within the code of the program that are not executed but are there to explain what the code is designed to do. External documentation can consist of online instructions to the user such as a detailed description of what the program does and how to use the program. It could also be offline instructions such as a user manual.
001_Definition of Programming This is known as the waterfall model of software development.
Analysis Specification
Design Architecture
Implementation Untested Software (coding)
Testing Product
Maintenance
There is a certain amount of backtracking in the actual evolution of a piece of software of any complexity, particularly if the software is constantly being updated. The Iterative Model reflects this. Maintenance Release
Requirements Product (Repeat) Analysis Testing
Specification Software
Design Implementation
Architecture
After testing, usually (i.e. almost always) some problems are found that must be analyzed again and then they must be made to conform to the required specifications, which in turn may require design changes and then must be re-implemented (coded). This process must be continuously repeated until the product can be released (i.e. it is perfect).
001_Definition of Programming