[Oberon] Tidyness of iteration.
Jörg
joerg.straube at iaeth.ch
Wed Nov 16 12:43:57 CET 2016
LOOP: R.I.P
Even the main Oberon loop (you know, the one that never ends :-) is
programmed with
REPEAT
UNTIL FALSE
Jörg
From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Bob
Walkden
Sent: Montag, 14. November 2016 20:35
To: ETH Oberon and related systems <oberon at lists.inf.ethz.ch>
Subject: Re: [Oberon] Tidyness of iteration.
(One must wonder about discarding REPEAT and WHILE and retaining LOOP with
strictly one EXIT.)
Er, definitely not. The read-ahead technique is very valuable in structuring
the software to match the structure of the input stream. It's a key
technique in Jackson Structured Programming, for example. It makes code a
lot easier both to write and, perhaps more importantly, to read and
understand. I can't tell you the number of programs over the years that I've
had to deal with where the programmer didn't understand this and
consequently ended up with a buggy, difficult-to-maintain mess.
The programming language RPGIII, at least when I used it in the 90s, had by
default an automatic outer loop structure and you determined your position
in the structure by means of bit-flags. It led to some really messy code,
which although quick to write (partly because of in-built DB2) was difficult
to support. Especially at 3:30 on a Sunday morning over a telephone dial-up.
If any of those are to be discarded, let it be LOOP, which encourages
badly-structured code.
B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20161116/7839f25b/attachment.html>
More information about the Oberon
mailing list