Structured Programming Paradigm

The structured programming paradigm (languages such as Pascal) is one where code is laid out as a series of instructions or statements and does not usually redirect to other areas of code (single use, single routine) and give a higher importance on logical flow over data whereas the object orientated programming (OO) paradigm (languages such as Java) contains reusable modules of code which can be redirected without reliance on any particular sequential order in the code and therefore considers data over logical flow (although such code is often written sequentially to aid in development / documentation) (multiple use, single routine).

The advantages of structured programming are largely in terms of the size and number of processes. Many of the algorithms we have written in pseudo code over the past few weeks have largely been a structured approach, i.e. a single solution for a single task as they are often easier to write, follow, edit and explain. A structured approach allows us to have a definitive number of steps to solve a small problem. This is also the main disadvantage of the structured approach that often the code has to be repeated if the same problem occurs in the flow of logic later in the program and if not, that code is redundant. Hence for small problems, we typically see far less processing than with the OO approach and this translates into more efficient use of resources. For larger, more complex problems the necessity to consider and re-consider data relationships based on logical flow becomes cumbersome and a very poor use of resources.

The advantages of OO programming are in the processing of complex systems where it may be necessary to consider many factors in an ‘object’ and this can be reused as required to process the data at hand. Structured programming can only consider data inheritance, structure and behaviour if part of the logical flow of the program, and hence the use of system resources, whereas OO programming can consider all of these aspects on a shared basis, hence efficiency improves.

Systems development over the last decade has invariably become more complex and hence, due to its sharing advantages above and resulting efficiency gains, it has become the perceived favourite today.

Being a PERL developer in the 1990s, a structured approach was the order of the day however this developed to a more OO approach (despite PERL being largely a structured language) in larger and more complex systems where it was possible to identify code that could be reused for multiple processes and included in a library, rather than in the sequential code (not a pure OO approach but in the middle ground).

Many older programs written in structured languages could be re-written as object orientated today however the budget and resources are often not justified when acceptable performance exists regardless of the paradigm. Therefore, although OO is the current perceived preference for programming, this does not mean that the structured paradigm is at an end as each must be considered on a case by case basis for suitability and effectiveness for the current objective. OO may be the preference; however it is not necessarily the most effective when taking into account all factors.

References

Cashman, T.J., Shelly, G.B, & Vermaat, M. E. (2004). Discovering Computers. Fundamentals ed. Boston: Course Technology.

Expert’s Exchange: OOP v Structured Programming [Online]. Available at: http://www.experts-exchange.com/Programming/Software_Design/Q_21776931.html (Accessed 7 December 2009).

Glenn, J. (2009) Computer Science: An Overview. 10th ed. Boston: Pearson Education.

Rob, M. A. (2004), Issues of Structured VS. Object Orientated Methodology [Online]. Available at: http://www.iacis.org/iis/2004_iis/PDFfiles/Rob.pdf (Accessed 7 December 2009).