[Oberon] A first experience with obc
Duke Normandin
dukeofperl at ml1.net
Tue Dec 7 02:32:16 CET 2010
On Tue, 7 Dec 2010, Chris Burrows wrote:
[snip]
> It is not a good idea to get into the habit of having multiple exits from a
> procedure. In this case they are unnecessary as the recommended Pascal /
> Modula-2 / Oberon programming style would result in:
[snip]
> This use of a BOOLEAN expression is a variation of an example given in the
> original Jensen and Wirth "Pascal User Manual and Report":
> If "found" is a variable of type Boolean, another frequent abuse of the if
> statement can be illustrated by:
>
> if a=b then found := true else found := false
>
> A much simpler statement is:
>
> found := a=b
[snip]
> LOOP with its arbitary exit points should only be used for the
> loop-and-a-half situations if and ONLY IF a WHILE, REPEAT and FOR loop is
> unsuitable. e.g.
[snip]
Personally, I appreciate the above "tips". I'll note them in my copy
of Nikitin's book.
--
Duke
More information about the Oberon
mailing list