Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
темы (сокращенные пересказы).doc
Скачиваний:
0
Добавлен:
01.05.2025
Размер:
315.9 Кб
Скачать

22. Programming. Steps in writing a program. Bugs.

Programming is the process of preparing a set of coded in­structions which enables the computer to solve specific prob­lems or to perform specific functions. The essence of computer programming is the encoding of the program for the computer by means of algorithms. The thing is that any problem is ex­pressed in mathematical terms, it contains formulae, equations and calculations. But the computer cannot manipulate formu­lae, equations and calculations. Any problem must be specially processed for the computer to understand it, that is - coded or programmed.

programming is the work of transforming requirements into something that a computer can execute.

Steps in writing a program

To write a program, software developers usually follow these steps.

  • First they try to understand the problem and define the purpose of the program.

  • Then they design a logical plan of the program. There are two common techniques for planning the logic of a program.

The first technique is flowcharting. A flowchart is a plan in the form of a graphic or pictorial representation that uses predefined symbols to illustrate the program logic.

The second technique for planning program logic is called pseudocode - an imitation of actual program in­structions. Pseudocode is less time-consuming for the professional programmer than is flowcharting. It also emphasizes a top-down approach to program structure.

  • Next they write the program instructions. This is called coding. The instructions will be written on a form called a coding form. The instructions we write will be recorded in a machine-readable form. The computer cannot understand instructions written in just any old way. The instructions must be written according to а set of rules that are the foundation of a programming language.

  • When the program is written, they test it: they run the program to see if it works and use special tools to detect bugs, or errors. Any errors are corrected until it runs smoothly. This is called debugging, or bug fixing. Debugging is a very important task in the software development process, because an incorrect program can have significant consequences for its users. There are two kinds of errors or bugs with which programmers must deal.

The first type is the coding error. Such errors are syntax errors that prevent the language processor from successfully translating the source program to object program code. The second type of bug is the logic error. The computer program can be successfully translat­ed, but the program does not produce the desired results. These errors are generally much more difficult to find and to correct than are coding errors. Logic errors can be avoided through careful planning of the program logic.

  • Finally, software companies write a detailed description of how the program works, called program documentation. They also have a maintenance program. They get reports from users about any errors found in the program. After it has been improved, it is published as an updated version.