In brief history of computer science, no single article has attracted more attention nor stirred more controversy than a seemingly innocuous 1968 letter to editor (of Communications of ACM) by Edsger Dijkstra [3], titled Goto Statement Considered Harmful. We were just emerging from Fortran era, when programming had not yet been thought of as an art or even a craft. A diagram of program flowlines, what came to be called a flowchart, would very nearly resemble a plate of spaghetti go to here and this, then go to there and that. Programs were held together with baling wire, little thought being given to their organizational structure. Dijkstra argued that an unbridled use of goto was heart of problem. In his opening sentence, he asserts that the quality of programmers is a decreasing function of density of goto statements in programs produce. He would later argue for elimination of goto statement altogether. At time, nothing could have been more controversial. Many programmers argued that some algorithms were impossible (or at very least, unnatural) to implement without use of goto. But new programming languages were on horizon (e.g., Pascal particularly), offering such structural constituents as do, until, then else, and case statements, whereby one could organize a program into successive levels of refinement, giving some credence to Dijkstra claim. Proponents of Dijkstra discipline of programming began to use a cryptic (at time) and somewhat obscure result of Corrado I3ohm and Giuseppe Jacopini [1] as justification for their optimism and enthusiasm. In effect, their work seemed to indicate that any algorithm could be written as a structuredprogram [2], i.e., as a program involving only repetition (whether of while do or repeat until variety), selection (typically characterized by if then else construct) and sequence of (possibly compound) statements, these three constructs perhaps being nested one within other to an arbitrary depth, down to level of elementary processes of assignment, input, and output. And most importantly, there was seen to be nb need whatsoever of employing harmful goto But Bohm-Jacopini result was not all that clearly understood at time. Even Dijkstra himself stated only that they seem to have proved logical superfluousness of goto statement. For it happens that it is not all that easy to give a totally convincing proof in elementary terms. We take up just such a challenge in this survey. We use opportunity to introduce reader to a modern software engineering framework for investigation, using topics that are important to a contemporary computer science research area known as software metrics, and we further employ an algebra of regular expressions, as most commonly encountered in theory of automata, all toward offering a modified form of now-classical Bohm-Jacopini result, and thus achieving a presentation blending new with old.
Read full abstract