Article View: comp.lang.misc
Article #6235Re: Turing programming language.
From: Dave Berry
Date: Tue, 24 Jan 1989 14:57
Date: Tue, 24 Jan 1989 14:57
42 lines
2021 bytes
2021 bytes
In article <12@euteal.UUCP> mart@euteal.UUCP (Mart van Stiphout) writes:
> In my view, the stop criterion should not be located somewhere in the
> middle of the loop. Furthermore, in my opinion your Pascal
> examples of loops proof their superiority to the Turing loops:
> the loop type is clear in a glance.
Two points:
1) exits from loops make some programs easier to write and understand.
2) a slightly different indentation scheme can make them just as easy to
read (IMO) as Pascal type loops.
The first point is discussed with supporting psychological evidence in
the following article:
@Article(soloway2,
Author="E. Soloway and J. Bonar and K. Ehrlich",
Title="Cognitive Strategies and Looping Constructs: An Empirical Study",
Journal="CACM",
Volume="26",
Pages="853-860",
Year="1983")
The second point is clearly subjective, but I think that if you don't
indent exit statements, loops are easy to read:
exit indented: exit not indented:
initialisation initialisation
loop loop
some code some code
exit when condition exit when condition
some more code some more code
end loop end loop
> I'm not the greatest C fan, but I think C loops are just what
> you need for correct loops.
Presumably you want to exclude the break statement!
Dave Berry, Laboratory for Foundations of Computer Science, Edinburgh.
db%lfcs.ed.ac.uk@nss.cs.ucl.ac.uk
<Atlantic Ocean>!mcvax!ukc!lfcs!db
Technical Details
Message-ID:
<1284@etive.ed.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!dbReferences:
<11@euteal.UUCP> <89Jan20.111000est.4328@turing.toronto.edu> <12@euteal.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!etive!lfcs!db From: db@lfcs.ed.ac.uk (Dave Berry) Newsgroups: comp.lang.misc Subject: Re: Turing programming language. Keywords: programming language Message-ID: <1284@etive.ed.ac.uk> Date: 24 Jan 89 14:57:05 GMT References: <11@euteal.UUCP> <89Jan20.111000est.4328@turing.toronto.edu> <12@euteal.UUCP> Sender: news@etive.ed.ac.uk Reply-To: db@lfcs.ed.ac.uk (Dave Berry) Organization: Laboratory for the Foundations of Computer Science, Edinburgh U Lines: 42