The late 60’s saw the emergence of structured programming, considered by some to have started with Dijkstra’s 1968 letter Go To Statement Considered Harmful . Dijkstra was concerned about the cognitive restrictions of humans when reading programs. He was also interested in formal proofs, and the adaptability and manageability of programs. Today some people still discuss the subject of the use of GOTO, but I think we are missing the point, and a chance to really advance things from the point that Dijkstra left us.
-
-
GOTO Trauma and Algorithmic Rhetoric
- Date:
- Tuesday, 08 Jan uary 2008 - 16:38 GMT
After the initial effort, the idea of structured programming then simply became abridged to “the removal of GOTO”. From the concern with the cognitive restrictions of humans in analyzing programs, we felt into a plain and naïve removal of the GOTO due to an unexplained harm that today is accepted without questioning or curiosity by a large number of computer science students.
Structured programming wanted to understand the human mind, the activity of programming, the nature of programs. But then the term simply became a nickname for modern programming languages, and an essential characteristic that a language used in a product manufactured by any serious company should have.
Old-time programmers criticized structured programming as unnecessary and as a funny way to do what they were already doing. They were having a reaction natural to many people, of avoiding to make a change to something about which you feel safe. But the stucturizers moved on, and developed the concepts that form the basis of high-level computer languages.
Today we have some people that believe that modern languages simply rely on the naïve concept that “nature abhors GOTO”. This is a harmful oversimplification of things. In universities, for example, what we should have is students learning to program in machine language, full of GOTOs, and also using modern languages, instead of just giving them JAVA and then start to talk about other languages as archaeological curiosities. Students must practice low-level programming for them to actually feel the difference between using a language where you only have GOTO, and one where you don’t have it.
Sometimes it seems to me that teachers and other older programmers are traumatized by the days they wanted to do structured programming, but the structured languages didn’t exist yet, and they are now trying to protect new programmers from the pains of low-level programming. Now they want to eradicate GOTO languages, and make structured languages the only ones in existence, in a kind of opposite reaction to the early days of computing. How scientific is that?
What I really want to talk about is my feelings about Dijkstra’s work. Of course he was concerned first of all about programmers creating correct code. After all, the concept of creating incorrect code is quite a paradox. But I think his objective was not to study the creation of code, nor the quality of this code. He was concerned about people reading the code and understanding it, and agreeing that it is right and that the program should be that way.
I realized that what he wanted to study is related to rhetoric. Rhetoric works with dialectics, which is the logical part that is everything that really matters. It helps people to understand this logical part.
In a speech, lecture or scientific article, the author usually has logical statements to inform or defend. The same way, a computer program has an effect or a function, which is its logical characteristic, that a programmer reading the program wants to understand. The author of a speech can use rhetoric to communicate his message in a better way, and lead the spectators to the path he intends. The same goes for writing programs. While obscure and machine-language programs can be perfectly right, they can be tough to crack. What Dijkstra wanted was to develop a form of algorithmic rhetoric, a set of techniques to make it easier for someone to understand a program. A science of manipulating (computer) language to drive the reader of your program to think what you want him to think, helping us overcome our said cognitive restrictions making us understand things more easily.
Last updated: Tuesday, 08 Jan 2008 - 16:38 GMT
-
Comments
-
Only after writing this I came to Knuth’s article “Structured Programming with go to statements”, a very nice piece that says everything I think on the subject (expect for the comparison to rhetoric). It has been probably even less read then Dijkstra’s letter… Pity.
Yesterday I found in my black notebook a very interesting quote from Dÿkstra that is somehow related to my ideas presented here:
Besides a mathematical inclination, an exceptionally good mastery of one’s native tongue is the most vital asset of a competent programmer.—Edsger Dijkstra
I might add that to have an exceptionally good mastery of a language might mean not only to speak correctly, but to speak “clearly”, or “enjoyably”. Putting in other way: rhetoric…