[Oberon] Procedure variables and local procedures
Paul Reed
paulreed at paddedcell.com
Fri Sep 29 18:05:06 CEST 2017
Hi Chris,
> What are the good reasons [for removing intermediately-scoped variables]?
Of course, it is possible to debate these kind of things until the cows
come home, and a lot of it in the end comes down to personal taste (more
than people sometimes admit).
But from my own personal experience with many languages over many years,
in commerce and academia (more the former) I would have to say that I am
interested in anything which reduces the number of places you have to
look, to understand someone else's code.
Prof. Wirth has, more than any other language designer I know, worked
tirelessly to reduce both the "fanciness" of language tools, and also the
number of things that go "clunk" behind the scenes. I think he caters
well to the experienced engineer who likes to carry only a small bag of
tools, and for those who need to produce convincing and reliable
implementations.
Any feature which reveals itself, under his exceedingly bright spotlight,
to be non-essential, while also simplifying implementation with its
removal, tends not to hang around for very long. But of course it is not
a perfect process, nor is it applied completely consistently.
As a good example of this reduction principle, but applied in reverse, is
the tiny amount of implementation code required to add the BYTE data type
to Oberon-07. I was amazed by this, mainly because I didn't twig the
difference between the type of a variable and its range.
> For example Coco/R by Moessenboeck makes extensive use of local procedures
And also multiple RETURN points from a function procedure! This
inscrutability prevented me from using Coco/R for a project (but I think
it was there in a previous incarnation, I don't think Prof. Moessenboeck
is to blame there!) Like LOOP (with its multiple EXITs, handy for writing
code but not for reading it), I again am very happy such features have
been removed for Oberon-07.
But like I said, a lot of it is taste, and fortunately there are lots of
languages to choose from!
Just my two cents, as my US friends would say!
Paul
More information about the Oberon
mailing list