× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello, all:

It amazes me how many people still debate this stuff, 30+ years after the "structured programming" revolution .. :-o

*Structured Programming*
In 1966 Bohm and Jacopini proved mathematically that it is possible to express any algorithm in terms of only three constructs, along with an arbitrary number of boolean flags [3]. The three constructs are:

1. sequences of statements (e.g. begin ... end blocks)
2. alternation (e.g., if-else, switch), aka. selection
3. repetition (e.g., while, for, do)

*References*
1. E. Dijkstra, "GoTo Statement Considered Harmful," Communications of the ACM 11:3, p. 147, March 1968.

2. E. Dijkstra, "Stepwise Program Construction," printed in Selected Writings on Computing: A Personal Perspective, Springer-Verlag, 1982, p. 2.

3. C. Bohm & G. Jacopini, "Flow Diagrams, Turing Machines, and Languages with Only Two Formation Rules," Communications of the ACM 9:5, p. 266, May 1966.

See this web page for more details:
http://en.wikipedia.org/wiki/Structured_program_theorem

Cheers,

Mark S. Waterbury

> smorrison@xxxxxxxxxxxxxxxxxxx wrote:
I am amazed at the number of people who say that ITER and LEAVE are good op-codes, but GOTO is a nasty op-code! What do you think ITER and LEAVE are, except a fancy GOTO without an explicit TAG? I felt the same way about CABxx (Case and Branch) when that was the popular new op-code!

Steve

Steven Morrison
Fidelity Express




James Lampert <jamesl@xxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
01/09/2009 10:40 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: Good places to use "The Cycle" in today's RPG was->Re: FW: Niftiest thing(s) you have done in RPG ILE or /FREE






GUY_HENZA@xxxxxxxxxxxxxx wrote:
I was taught structured programming in 1980 and I have never written
a new
program with a GOTO, ITER or LEAVE. I consider them to be poor
program
design.

Hmm. Sounds like you were taught by a fanatical disciple of Wirth.

There is nothing inherently bad about ITER or LEAVE, provided they are used in situations (e.g., brute-force table look-up) in which premature exit of a loop is the norm, and completion of the loop is the exception.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.