This entry is a response to our online assignment in Graduate School about Structured Programming
Structured Programming Languages
I vividly remember the first time I encountered a programming language. It was in high school and the experience was a bit terrible. Not just because of the blue screens and yellow font colors that results to again a plain text but this time with black background color and white fonts but because of the complexity of knowing its rules which we all known to be as syntax. Every assignment was a failure but the lesson I learned is eternal. Why? It was during that time when I get to appreciate structure or modules. It is where I embraced the idea that in order to solve a problem, a procedure should be followed. Well, yes, thanks to Pascal then. I always look forward to the END statement whenever I type in the BEGIN.
This particular experience is just a brief explanation of what structured programming languages are. Programmers tend to focus on the result that the structure of the code and how solutions are implemented are often overseen. This apparently results to a well-known problem of the developers called as “Spaghetti Code”. In fact, when this subset of procedural programming was introduced, they would like to eliminate or reduce the existence of the GOTO statement. This has been brought out to the famous article of Edsger Dijkstra entitled “Go To Statement Considered Harmful”. So therefore, this programming scheme enforces a logical structure on the code being written in order to make it more efficient and easy to understand.
Structured programming presents the following structuring techniques or methodologies which are also basis to determine whether a programming language supports it:
- The logic of the program is a structure composed of similar sub-structure. In short and simple terms, it is a modular programming that subdivides the codes into different modules, procedures, or functions. The JavaScript code snippet below is an example of an example of a function that specifically answers a need or a requirement.
- It employs top-down design model which developers map out the overall code into different subsections
- Program flow follows a simple hierarchical model that employs looping constructs such as “for”, “while”, or “repeat”. It is then discouraged to use the “goto” statement. There are also flow structures such as sequence for the flow of execution and selection for conditional statements
Most of the programming languages used today applies the structured programming in order to avoid the issues of the unstructured one
What is the result of an unstructured code or if the Programming Language does not support it?
The result of an unsupported structural technique in a programming language is a poorly organized code. Some called it “Spaghetti Code” but I rather call it “Pansit Palabok” The code answers the need of the moment but some other aspects are overseen that even results to a bigger problem. Imagine a code where all the statements are just in the main body. Not just ineffective but the criteria such as readability, flexibility, and maintenance are often violated. Should you want to grow old early? A great recommendation is to make your code unstructured.
Web References:
- http://en.wikipedia.org/wiki/Structured_programming
- http://en.wikipedia.org/wiki/Top-down_design
- http://en.wikipedia.org/wiki/Procedural_programming_languages
- http://searchcio-midmarket.techtarget.com/definition/structured-programming

