Structured programming refers to a set of quality standards that make programs both more verbose and more reliable. Benefits like readability, ease of maintenance and reliability outweigh the added complexity these standards impose. The main goal of these standards is to eliminate what is commonly called ‘spaghetti code’ – code that is built on negative practices and using techniques that are frowned upon in the expert coding community.
Technipages Explains Structured Programming
This includes things like the GOTO statement – a brutal and direct jump from one part of a program to another, without any regard for what section of a program is active or in use. Loops can be broken this way, but in all but the direst circumstances, it should be avoided. This means that in order to maintain the coding standards, the programmer needs to deliberately choose a more complex method of achieving a goal – ideally without the GOTO command.
Different languages support this type of standard, but some of the most common examples include C, Pascal and the dBASE software command language. Truthfully, there are standards like those that make up structured programming in just about every coding language, though they may simply be considered ‘best practice’ rather than being a completely formal set of standards. The overall program structure of a program should always show what a program is supposed to do. This means that structured programming dictates a certain tree-setup. The first task is first, and everything that follows needs to be ordered in a logical manner.
Common Uses of Structured Programming
- Structured programming standards forbid the use of ‘brute force’ commands like GOTO.
- Both formal rules and guidelines are part of the structured programming standards.
- Proper indentation and spacing is part of structured programming.
Common Misuses of Structured Programming
- Structured programming refers to a programming language that employs a formal structure.