ComputersProgramming

Structured Programming

Structured programming is the largest achievement in this field at the moment. While almost everyone has a general idea of it, almost no one can give a concrete and clear definition of the term. Structured programming sets the main goal of writing programs of the least complexity, forcing the programmer to think clearly, facilitating the perception of the program. Its text must be made so that it is read from top to 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 corruption.

The basic principles of structured 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.

You can use one or two of any kind at the same time. 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.

The simplicity of the initial constructions in structured programming prevents the emergence of information links, as well as entangled control transmissions. The complexity of the programs is noticeably reduced with the increase in the structuredness of the modules, their clarity increases, 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 is, the structure of the program texts themselves, depends entirely on the language used for this. Of course, the question arises, which one is best suited. Modern software development tools 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 practically impossible to implement the principles inherent in the concept of structured programming. This language is focused on writing program code at a low level.

Structured programming is basically based on communication with people, 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 relative to the previously mentioned 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 structure of the program 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.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.