## Reflections on structural programming

At first, I wanted to title the article something defiant, for example, “How science can turn into a religion”, “Trapped by distortions of the meanings of structured programming” or “What they forgot to tell you about structured programming”, but as a result I still kept the current title and I hope it irritates the readers. And although other titles are more clickbait, they still reflect the meaning of the article to a greater extent than neutral “thoughts”.

And the reason for this article was one of the comments to the previous publication of the Management of memory and resources that are partitioned without errors, where they wrote “it was proved mathematically”. And I immediately remembered my small investigation, when I tried to understand one of the “mathematical proofs”, which we are all told about in computer science classes at school.

Surely everyone remembers that any algorithm can be represented in the form of three types of algorithmic constructions, routing, branching and repetition? And sometimes they add that this theorem was put forward by **proved** e. Dijkstra in the 70s of the last century, including including the widely publicized alleged ban on the use of goto operators.

### Structural programming

Structured programming is a concept that appeared in the late 1960s and influenced the further development of imperative programming. Edsger Dijkstra is considered the founder of structural programming. His credit lies in the development of this concept, as well as in its promotion.

The main principles of structured programming were formulated by Edsger Dijkstra mainly Dahl, O.-J., Dijkstra, EW, Hoare, CAR Structured Programming.

However, while developing a vocabulary for my programming language, I have repeatedly had some doubts about the validity of these facts. After all, this concept (that any algorithm can be presented in the form of three types of algorithmic constructions) does not fit exception handling and some other elements that are mandatory for all modern programming languages.

### In search of truth

Therefore, I decided to deal with E. Dijkstra’s proof, and the results I found surprised me a lot. Everything turned out to be about a scientist who raped a journalist, or more tolerantly in an anecdote: “Not Kats, but Rabinovych. Not in the lottery, but in cards. Not a million, but a hundred rubles. And he didn’t win, but lost.”

In other words, everything turned out to be completely wrong. The missing context, which is necessary for the correct understanding of this information, the structural theorem was published and proved by E. Dijkstra and much more, which radically changes the perception of some issues related to structural programming. And since this is actually a mandatory base that is used in school when learning the basics of programming, I think that it is necessary ~~tear off the covers~~ tell about the facts found.

I started by trying to find the primary source of the publication in which E. Dijkstra proposed and proved the theorem on the sufficiency of three algorithmic constructions. And did not find it. But in the process of searching, I came across a detailed article with an analysis of information that interests me and links to primary sources: Avacheva T.G., Prutskov A.V. Modern view of the concept of structural programming

### Conclusions

As a result, the results of my search came out:

- The structural theorem that any block diagram can be transformed into a block diagram consisting of blocks of three types: following, selecting and repeating was proved in 1966 by the Italian scientists K. Behm and J. Jacopini (the article was published in Italian in 1965) Boehm’s Theorem – Jacopini – Wikipedia. This theorem
**purely theoretical**proven**subject to some restrictions**and was mentioned by E. Dijkstroy, in his work “Go To Statement Considered Harmful”. - The principles of structural programming were proposed by Ege. Dijkstroy is designed to improve the style of the program code due to the use of control structures and other instructions that control the course of the algorithm, i.e. this is not a proven theorem, only
**offer**refuse to use, and not only from**the goto operator**but also from**assignment operator**:*“The goto operator allows us to loop back through a portion of a program, while the assignment operator can create the necessary difference in state between successive iterations.”* - E. Dijkstra in his work formulated the principles of structural programming in an attempt
**automate proofs of program correctness**(*a program is a sequence of calculations. Calculations can be written in mathematical formulas. So, it is possible to prove the theorem about the correctness of the program*), but still the final conclusion*“Testing only detects the presence, but not the absence, of errors”*. - In addition to the three types of algorithmic constructions (following, branching, and repetition), a mechanism for handling errors (exceptions), and sometimes processing interruptions and performing parallel actions, is also needed, without which the full implementation of individual algorithms will be impossible.

### Z.I.

Happy New Year!