Structured programming is athe largest achievement in this field at the moment. While almost everyone has a general concept of it, almost no one can give a concrete and clear definition of this term. Structured programming sets the main goal to write programs of the least complexity, forcing the programmer to think clearly, facilitating the perception of the program. The text of it must be done in such a way that it is read from the top to the bottom. This condition is violated if in the program code go to operators are encountered, since they violate the structure of the entire program segment. While this indicator can not be considered the most convenient, one can still say that the presence of this operator in the program code is the most striking type of structure violation. Module bodies and applied basic structures must be resistant to hardware failures, program errors, and source data distortions.
The basic principles of structural programming are as follows. Any program can be easily synthesized on the basis of elementary constructions of three basic types:
- a simple sequence;
- conditions or alternatives;
- repetitions, that is, cycles and iterations.
Use can be one or two of any kindSimultaneously. Each structure has a common feature - the only control transfer point in the structure and the only entry point to the structure. This kind of construction has a disciplining and systematizing significance.
Simplicity of the original structures in the structuralprogramming prevents the emergence of information links, as well as entangled control transmissions. The complexity of the programs is noticeably reduced with increasing the structuredness of the modules, their visibility is increasing, and this helps to reduce the number of errors. However, structuring has a drawback - for the beauty and clarity of the program code, you have to pay extra memory, as well as the time necessary for their implementation on the computer.
Structured programming, that isstructure of the program texts themselves, entirely depends on what language is used for this. Of course, the question arises, which one is best suited. Modern means of software development are considered to be the best languages that implement a structural approach to programming. Among the most common are Basic, Pascal and FoxBASE. For example, in Assembler, it is almost impossible to implement the principles inherent in the concept of structured programming. This language is focused on writing software code at a low level.
Structured programming is basicallyoriented to communicate with people, and not with machines, so it helps to write programs that represent a clear and simple solution to the task. The programmer must think in terms of basic structural constructions.
If we talk about the position relatively earliermentioned operator go to, then it should be avoided to use wherever possible, but this should not affect the clarity of the program. Sometimes the use of this operator is simply necessary to exit from some section of the program or cycle, and also to avoid the appearance of too deep forks, especially since the transition is associated with lower levels of programs. At the same time, the program structure remains easily readable from the top down. The worst case of using this operator is associated with a transition from the bottom up.
To facilitate the reading of the program, often add empty lines between sections. It is worth writing the text of the program with shifts so that you can read the sequence of actions and the number of attachments.
</ p>