Structured Programming Concepts - Gossip Inn
Structured Programming Concepts

Structured Programming Concepts

Share This


Structured programming (sometimes known as modular programming) is a subset of imperative programming that enforces a logical structure on the program being written to make it more efficient and easier to understand and modify. It is a programming paradigm aimed at improving the clarity, quality and development time of a computer program by making extensive use of subroutines (sequence unit), block structures, for and while loops-in contrast to using simple tests and jumps such as the goto statement which could lead to "spaghetti code" which is difficult both to follow and to maintain.

Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or set of similar functions is coded in a separate module or sub-module, Which means that code can be loaded into memory more efficiently and that modules can be reused in other programs. After a module has been tested individually, It is then integrated with other modules into the overall program structure. Program flow follows a simple hierarchical model that employs looping constructs such as "for", "repeat" and "while". Use of the "Go To" statement is discouraged.

Structured programming can be viewed as the pulling together, or synthesization of such ideas as program modularity and top down design, and the concrete representation of them at the program coding level. It is a manner of coding and organizing programs that makes them easier to understand, to test and to modify. Results have demonstrated that employed together with other improved programming technologies, can lead to spectacular increases in programmer productivity and correspondingly spectacular decreases in the error rate of resultant code. Structured programming methodology tries to resolve the issues associated with unconditional transfers to enable programmers follow the logic of programs. Much of a program's complexity arises from the fact that the program contains many jumps to other parts of the program jumps both forward and backward in the code. Furthermore, as a program undergoes change during it's development period, as it gets further debugged during it's maintenance period and as it gets modified in subsequent new projects, the complexity of the program grows alarmingly. New jumps are inserted, thus increasing the complexity.

In some cases, new code is added because the programmer cannot find the existing code that performs the desired function, or is not sure how the existing code works, or is afraid to disturb the existing code for fear of modifications, is a program that is nearly unintelligible. This is the software equivalent of being shop-worn, the time when it is better to throw the whole thing out and start over.

Indeed structured programming concepts discourage the use of  'GO TO' statements and encourage program blocks, modularity, top-down design approach and re-usability among others. Programs written with the structured approach are more readable and more reliable. Also, the cost and time of developing software is less when structured programming is adopted since smaller units of programs can be written independently (sometimes by different individuals or groups) and then combined to achieve the desired end product.

No comments:

Post a Comment

Pages