On Jun 30, 2005, at 3:06 PM, Stefan Pantke wrote:
Am 30.06.2005 um 20:42 schrieb Will Leshner:
On Jun 30, 2005, at 11:30 AM, Stefan Pantke wrote:
If RB would require the developer to use (..) for all parameters,
code would be more readable
I think subroutine calls without parens is just easier to read. In
general, I find that less extraneous punctuation makes code more
readable.
Well, the RB community tends to think different than
the world ;-)
If I remember correctly, an Appollo mission failed due
to a Fortran error coding error related to syntactical
issues. But I may be wrong.
Perhaps you're thinking of Ariane 5.
In fact, I'm absolutely sure, that parens for parameter
lists make things not a bit, but MUCH more readable - not
to speak of parsing stuff, since is only a technical issue
for the RB compiler writer.
This language design issue leads to the described problem.
And just this is a good reason to drop this concept.
I asked for an EBNF, but RS never provided one. And not
even a single page in the docs - I may have overlooked it -
explains on one page, how precedence is defined.
RB's goal is to be a 'secure' and 'simple' language. At least
for this reason, the design is bad. You probably know, how
precedence is defined, but I'm pretty sure, that others
don't know. Moreover, I'm sure that other programming beginners
will most likely write code, which gets rejected due to some
precedence rule and unexpected evaluation.
Have a look at this
foo 1+ goo 2
Is the meaning of this obvious? Is it
foo( 1 + goo( 2 ) )
or
foo( 1 ) + goo( 2 )
Do you really think, that the first line is more readable
than the 2 lines below? Is the first line syntactically correct
with respect to RB anyway?
Another example:
dummyI = max( 2, max( 3,4 ))
dummyI = max 2, max( 3,4 )
dummyI = max( 2, max 3,4 )
dummyI = max 2, max 3,4
The first line compiles, while all other lines report error messages.
Can you explain why?
Indeed I can. In the last three cases, the lack of parentheses means
that max 3, 4 must be a subroutine that does not return a value. Thus
nothing is being passed to the second parameter in the outer call to
max.
--------------
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|