[mercury-users] Pred defns
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Mar 30 19:10:19 AEST 1998
On 30-Mar-1998, Tyson Dowd <trd at stimpy.cs.mu.oz.au> wrote:
> On 30-Mar-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
>
> > Well, that's fairly vague, I guess. I have a precise specification
> > (150 lines of code) if anyone's interested.
> >
> > Comments?
>
> At a glance, I don't see any particular technical problems with this,
> however it should be noted that this still leaves the user doing the
> work of threading arguments -- only naming them has been automated.
>
> Some of the other proposals (EDCGs for example) allow naming and
> threading to be done automatically. This means the old example of
> adding a state pair to some code is almost completely painless, compared
> to this proposal, where it is only somewhat painless.
I agree that the hidden argument proposals do make it somewhat easier
to write code. Only somewhat, mind you, since often you will still need to
*examine* every part of the code to see that it threads the hidden arguments
in the right order, even if you don't need to change it. In fact one
could argue that by forcing you to change the code, it forces you to examine
it, which is not such a bad thing.
But my main criticism is that I think making it easier to add hidden
arguments in this way often this comes at the expense of making the
modified code harder to read. Because the arguments are hidden, it is
harder to understand the program's data flow.
In general improving writability at the expense of readability is not a
good trade-off for languages other than those designed specifically for
rapid prototyping, because in long-lived programs, code is written once
and read hundreds of times. I remain unconvinced that it would be a
good trade-off in this particular case.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the users
mailing list