COMPUTER STUDIES

PROGRAM DEVELOPMENT

A computer program is a sequence of instructions written to perform a specified task with a computer. A program is a set of instructions written by a programmer. Program contains detailed instructions and complete procedures for performing the relevant tasks. A computer requires programs to function, typically executing the program’s instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions. The same program in its human-readable source code form, from which executable programs are derived (e.g ., compiled), enables a programmer to study and develop its algorithms. A collection of computer programs and related data is referred to as the software.

 

CHARACTERISTICS OF A GOOD PROGRAM

Every computer requires appropriate instruction set (programs) to perform the required task. The quality of the processing depends upon the given instructions. If the instructions are improper or incorrect, then it is obvious that the result will be superfluous. Therefore, proper and correct instructions should be provided to the computer so that it can provide the desired output. Hence, a program should be developed in such a way that it ensures proper functionality of the computer. In addition, a program should be written in such a manner that it is easier to understand the underlying logic. A few important characteristics that a computer program should possess are as follows:

  1. Portability: Portability refers to the ability of an application to run on different platforms (operating systems) with or without minimal changes. Due to rapid development in the hardware and the software, nowadays platform change is a common phenomenon. Hence, if a program is developed for a particular platform, then the life span of the program is severely affected.
  2. Readability: The program should be written in such a way that it makes other programmers or users to follow the logic of the program without much effort. If a program is written structurally, it helps the programmers to understand their own program in a better way. Even if some computational efficiency needs to be sacrificed for better readability, it is advisable to use a more user-friendly approach, unless the processing of an application is of utmost importance.
  3. Efficiency: Every program requires certain processing time and memory to process the instructions and data. As the processing power and memory are the most precious resources of a computer, a program should be laid out in such a manner that it utilizes the least amount of memory and processing time.
  4. Structural: To develop a program, the task must be broken down into a number of subtasks. These subtasks are developed independently, and each subtask is able to perform the assigned job without the help of any other subtask. If a program is developed structurally, it becomes more readable, and the testing and documentation process also gets easier.
  5. Flexibility: A program should be flexible enough to handle most of the changes without having to rewrite the entire program. Most of the programs are developed for a certain period and they require modifications from time to time. For example, in case of payroll management, as the time progresses, some employees may leave the company while some others may join. Hence, the payroll application should be flexible enough to incorporate all the changes without having to reconstruct the entire application.
  6. Generality: Apart from flexibility, the program should also be general. Generality means that if a program is developed for a particular task, then it should also be used for all similar tasks of the same domain. For example, if a program is developed for a particular organization, then it should suit all the other similar organizations.
  7. Documentation: Documentation is one of the most important components of an application development. Even if a program is developed following the best programming practices, it will be rendered useless if the end user is not able to fully utilize the functionality of the application. A well-documented application is also useful for other programmers because even in the absence of the author, they can understand it.

 

PRECAUTION IN WRITING GOOD PROGRAM 

  1. Do not rush; be stable, steady and patient during program writing.
  2. No step skipping.
  3. Follow order of execution.

 

STEPS INVOLVED IN PROGRAMMING

Steps involved in programming are:

  • Analyzing the Problem.
  • Algorithm design / Pseudocode.
  • Flowchart.
  • Coding.
  • Debugging.
  • Testing.
  • Final output.
  • Documentation.

 

1) Analyzing the Problem (Problem Definition): This is the first step of programming and involves getting the following information:

  • What is system.
  • How is it working.
  • Who are the users.
  • What is the problem.
  • Who will use.

These things are very important for the programmer because it provides him the basis for planning about the programming and to control the potential difficulties that may arise.

 

2) Algorithm Design (Problem Analysis): In this stage all the instructions which are to be performed at different stages are listed. These are in simple English Language. We may call it a strategy.

 

3) Flowchart: It is a graphical tool that shows the steps/stages which are to be executed in a program. All the steps which are written in the second stage are now presented in a diagrammatic manner so as to make it easily understandable. Making of flowchart helps us in increasing our process of program development because it facilitates us to define the logic, detecting and removing errors in a program design.

Types of flow chart

  • System Flowchart shows the processing of entire system. It describes the input/ output devices, the media being used and the flow of data in the system.
  • Program flowchart shows the complete steps involved in the execution of a program including I/O, processing, loops and branching. It is more detailed than system flowchart.

 

4) Program Coding: In this step programmer writes the instructions in a computer language to solve the problem. All coding process depends upon the information we obtained in previous steps. Choice of language depends upon the requirements and facilities available within a language.

 

5) Program Debugging: In this stage we remove all the errors in the program because when we are coding, there are chances that some mistakes may occur at that time. Here the program is executed manually, and it is called DRY RUN. This is done several times until all the errors are removed from the program and the system become errors less.

 

6) Program Testing: In this stage we test the program by entering dummy data (which include usual, unusual and invalid data) to check the behaviour and result of the program towards the given data.

After going through all the above stages, the program is given the TRUE DATA. Here the programmer expects the positive results of the program and expects full efficiency of the program.

 

7) Program Documentation: Most of the programmer neglects this stage by giving many reasons. But this is very important because this will help the programmer to correct the problems that may occur in the program.

There are two types of documentation:

  • User Manual provides the use of complete information about how to operate the program and what needs to be done when the user faces a problem.
  • Technical Manual contains the technical information about the program. This is used to get technical details of the program, when the system is not working properly or requires modifications.

 

COMPILER

A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or “code” that a computer’s processor uses. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor. The file that is created contains what are called the source statements. The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements. A compiler is a program that translates a source program written in some high-level programming language such as Java into machine code for some computer architecture. The generated machine code can be later executed many times against different data each time.

When executing (running), the compiler first parses (or analyzes) all of the language statements syntactically one after the other and then, in one or more successive stages or “passes”, builds the output code, making sure that statements that refer to other statements are referred to correctly in the final code. Traditionally, the output of the compilation has been called object code or sometimes an object module . (Note that the term “object” here is not related to object-oriented programming.) The object code is machine code that the processor can process or “execute” one instruction at a time.

More recently, the Java programming language, a language used in object-oriented programming , has introduced the possibility of compiling output (called bytecode ) that can run on any computer system platform for which a Java virtual machine or bytecode interpreter is provided to convert the bytecode into instructions that can be executed by the actual hardware processor. Using this virtual machine, the bytecode can optionally be recompiled at the execution platform by a just-in-time compiler.

Traditionally in some operating systems, an additional step is required after compilation that of resolving the relative location of instructions and data when more than one object module was to be run at the same time and they cross-referred to each other’s instruction sequences or data. This process was sometimes called linkage editing and the output known as a load module.

A compiler works with what are sometimes called 3GL and higher-level languages. An assembler works on programs written using a processor’s assembler language.

 

INTERPRETER

An interpreter reads an executable source program written in a high-level programming language as well as data for this program, and it runs the program against the data to produce some results. One example is the Unix shell interpreter, which runs operating system commands interactively. The interpreter source program is machine independent since it does not generate machine code. An interpreter is generally slower than a compiler because it processes and interprets each statement in a program as many times as the number of the evaluations of this statement. For example, when a for-loop is interpreted, the statements inside the for-loop body will be analyzed and evaluated on every loop step. Some languages, such as Java and Lisp, come with both an interpreter and a compiler.

Leave a Reply

Your email address will not be published. Required fields are marked *

Blogarama - Blog Directory