Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Education » math-teach

Topic: Structured Programming
Replies: 69   Last Post: Mar 7, 2014 7:18 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Robert Hansen

Posts: 8,210
From: Florida
Registered: 6/22/09
Structured Programming
Posted: Mar 1, 2014 7:58 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Feb 28, 2014, at 10:59 PM, Joe Niederberger <niederberger@comcast.net> wrote:

- -----------------------
I'll have to save the full response for later, but the short answer for the topic of structured programming is that structured programming is not the inclusion of these constructs, but the elimination of the unrestricted branch (GOTO).
- -----------------------

In your full response please remember to explain to us how you eliminate ?GOTO? without those constructs present.


The following wikipedia article describes these block constructs as being developed in the 1950s.

http://en.wikipedia.org/wiki/Block_(programming)

I suspect that you and Lou are going to immediately ask ?Which 1950s??, so I?ll be more thorough?


The development of IAL (International Algebraic Language now known as ALGOL58) began in 1955 in Germany by the GAMM. In 1957 the ACM also started an effort to produce a universal programming language. Later that year (1957) the GAMM group and the ACM group joined forces.

http://www.softwarepreservation.org/projects/ALGOL/report/Algol58_preliminary_report_NumerischeMathematik.pdf


In 1959 Backus describes ALGOL58 as having been completed in May 1958. He clearly describes the BEGIN/END construct and calls them ?compound statements? (page 4). IF/BEGIN/END is also described. The FOR construct is crap. This paper is also where Backus introduces the precursor to BNF.

http://www.softwarepreservation.org/projects/ALGOL/paper/Backus-Syntax_and_Semantics_of_Proposed_IAL.pdf


In February 1959, an article by Julian Greene of IBM, titled ?Possible Modification to the International Algebraic Language" was published in the ACM. I have attached a link to an image of the last page (I rented the article). At the bottom of that page you will note that Julian specifically eliminates the GOTO statements required by the original IAL by fixing the FOR construct and incorporating the BEGIN/END syntax. Not only that, his FOR construct is remarkably similar to C?s FOR construct, the version we use to this day.

https://www.dropbox.com/sh/hz6q14yeafltfmn/2sK6NvC7BI


in Dijkstra?s 1968 Article ?Go To Statement Considered Harmful", he make?s note that deprecating the goto statement was discussed in 1959 by Heinz Zemanek. Maybe we should email Heinz and ask him ?What were you thinking?? He is still alive.

http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_Harmful.html

"Finally I should like to record (as I remember it quite distinctly) how Heinz Zemanek at the pre-ALGOL meeting in early 1959 in Copenhagen quite explicitly expressed his doubts whether the go to statement should be treated on equal syntactic footing with the assignment statement. To a modest extent I blame myself for not having then drawn the consequences of his remark?


It looks pretty much like the die was already cast in the 1950?s, no?


At a minimum, other than declarations and assignments, you need three things for structured programming.

1. Blocks
2. If..Then..Else
3. For..

I consider #1 a ?big idea?, second only to the notion of subroutines and functions. It does more than just allow for structured programming. It defines scope, allows one to use local variables, and very importantly, allows one to nest blocks of code. #2 is strong in ALGOL58 and #3 is strong in Greene?s version, which is the modern version. It looks like ALGOL60 adopted a FOR loop slightly different. In January 1960, the ALGOL60 report "Report on the algorithmic language ALGOL 60? was released. I realize the report was released in January, 1960, but the work was done in 1958 and 1959. You will notice that the FOR constructs are now there (page 307, section 4.6), including WHILE and UNTIL. I think Greene?s form (above) was better, obviously, since that is what we now use.

http://www.fh-jena.de/~kleine/history/languages/Algol60-ACM.pdf


The real problem with GOTO isn?t that it allows programmers to branch to strange places. It is that it allows programmers to *unintentionally* branch to strange places. You can satisfy #2 and #3 with GOTO statements alone, and that is what programmers did. But GOTO statements require labels or line numbers and keeping track of all these labels and/or line numbers is a very messy business. The basic patterns for IF/THEN/ELSE and FOR/WHILE/UNTIL are pretty simple with GOTO statements and were well established even in the 40?s with machine/assembler code. When programmers wrote code that branched to strange places it was usually due to error, not intent. But without the block constructs like those above, you cannot write code without GOTO.


I still think these constructs showed up in language very fast. What if I said maybe that was due to the mathematical training of the minds of the time? That this enabled them to see *order* in programming as quickly as they did? Would that appease you?



On Feb 28, 2014, at 10:59 PM, Joe Niederberger <niederberger@comcast.net> wrote:

- -----------------------
What would the response of those crowds Lou mention be, if instead of Dijkstra proselytizing that the (three) basic control statements were provably sufficient for *all* computations, but instead the suggestion that they were thought to be good enough for most business and scientific problems of the sort generally seen?

You really need to read the paper you cited. The following link is to the first couple of pages?
- -----------------------

https://www.dropbox.com/s/bt7tfb5ahxxplwc/BohmJacopini.pdf

I think people like Dijkstra advocating structured programming was what got the word out. I can?t see this very obtuse paper on flowcharts being a deciding factor. But even if it did play a role in convincing others, how does that relate to the development of the structured elements in the 50?s that made GOTO?s unnecessary?


I might add that it is probably a good thing that these articles cost money. There is an enormous number of interesting and historical papers in the ACM archives and I probably wouldn?t get anything done if I had unrestricted access to them.

Bob Hansen


Date Subject Author
3/1/14
Read Structured Programming
Robert Hansen
3/2/14
Read Re: Structured Programming
kirby urner
3/3/14
Read Re: Structured Programming
Greg Goodknight
3/3/14
Read Re: Structured Programming
kirby urner
3/2/14
Read Re: Structured Programming
Louis Talman
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
Robert Hansen
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
kirby urner
3/2/14
Read Re: Structured Programming
Robert Hansen
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
kirby urner
3/2/14
Read Re: Structured Programming
Joe Niederberger
3/2/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
kirby urner
3/3/14
Read Re: Structured Programming
Robert Hansen
3/4/14
Read Re: Structured Programming
kirby urner
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Robert Hansen
3/4/14
Read Re: Structured Programming
Robert Hansen
3/5/14
Read Re: Structured Programming
kirby urner
3/6/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
kirby urner
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Robert Hansen
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/3/14
Read Re: Structured Programming
kirby urner
3/3/14
Read Re: Structured Programming
Joe Niederberger
3/4/14
Read Re: Structured Programming
kirby urner
3/4/14
Read Re: Structured Programming
Joe Niederberger
3/5/14
Read Re: Structured Programming
Joe Niederberger
3/5/14
Read Re: Structured Programming
Joe Niederberger
3/5/14
Read Re: Structured Programming
kirby urner
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
Louis Talman
3/6/14
Read Re: Structured Programming
Robert Hansen
3/7/14
Read Re: Structured Programming
Louis Talman
3/7/14
Read Re: Structured Programming
Robert Hansen
3/7/14
Read Re: Structured Programming
Louis Talman
3/7/14
Read Re: Structured Programming
Robert Hansen
3/7/14
Read Re: Structured Programming
Louis Talman
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
kirby urner
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
kirby urner
3/6/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/7/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
kirby urner
3/6/14
Read Re: Structured Programming
Joe Niederberger
3/7/14
Read Re: Structured Programming
Robert Hansen
3/6/14
Read Re: Structured Programming
Joe Niederberger

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.