Question Daupadie Computing & ICT

Structured and unstructured programming

What are the differences between structured programming and unstructured programming?

Did you know that we write custom assignments? We have experts in each specific subject area with vast experience. Get a complete answer and find out more about our writing services.

Answer Internal Staff

Approaches to programming are often categorised as being either structured or unstructured.

Unstructured programming predates structured approaches, and can be found in languages such as BASIC, FORTRAN and machine code. It involves a single code block, and makes extensive use of GOTO in order to control the flow of the execution and add complexity to the program. As a result of this constant jumping around, unstructured code can become very difficult to follow and maintain – especially when it comes to larger projects. This also makes it much more difficult for multiple programmers to collaborate on the same code. Another noteworthy feature of unstructured programming is that there is only one (global) scope for variables; there is no concept of local variables.

In contrast, structured programming is modular in nature, making it considerably easier to follow and maintain. These approaches are common to the majority of modern programming languages. Rather than using GOTO to control the flow of execution, structured approaches make use of loops and the execution of smaller, nested blocks of code which can have their own locally-scoped variables. This improves readability and makes it easier to improve small parts of a program without having unintended effects in other areas. As a result, it is much easier for multiple programmers to collaborate by working separately on isolated parts of the code.

Comparing the two, it can be seen that structured approaches are superior for almost all purposes; they are easier to read and maintain, they are scalable (to very large projects), and can allow for the expression of rather complex solutions in a much simpler form.