Categories: Computing and ICT

Structured and unstructured programming

Question

What are the differences between structured programming and unstructured programming?

Answer

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.

References

AskanAcademic.com

Recent Posts

Julian Assange: A Legal Odyssey

Question: Who is Julian Assange and what are the legal battles he is facing? Answer:…

4 months ago

The Bosman Ruling and EU Law

The Bosman ruling is a landmark 1995 decision by the European Court of Justice (ECJ)…

4 months ago

The Manifestation of Luck Through Music

Can listening to music manifest good luck as suggested on the social media hashtag #manifestationsongs

4 months ago

Deferred Payment Agreements (DPAs)

A Deferred Payment Agreement (DPA) is a financial arrangement, often used in the context of…

5 months ago

British English: Withdrawal vs Payout vs Pay Out

The terms "withdrawal," "payout," and "pay out," while related in the context of financial transactions,…

5 months ago

Dissertation Writing Services in the UAE

Yes, dissertation / thesis writing services are completely legal in Dubai and the wider UAE.…

7 months ago