On 9/14/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
> On 9/14/06, Philip Ganchev <[EMAIL PROTECTED]> wrote:
> > On 9/13/06, Axel Liljencrantz <[EMAIL PROTECTED]> wrote:
[...]
> > This feature makes the language more complicated, and so makes code
> > harder to read.  To understand an if-statement that has an end
> > condition, I now have to remember to check not only its if-condition
> > but also the end-condition.  I expect that more bugs will occur from
> > forgetting to check this, than the bugs avoided by it.
>
> No you don't. You don't have to change a single line of code. You
> simply have the _option_ of explicitly stating what a specific end
> block ends.

I was talking about reading and debugging code written by someone else
or some time ago.  Perl is notorious for allowing you to write an
expression in variuos ways, making Perl code notoriously hard to read.

The point is that end epxansion give the user choices to make a
mistake, when Fish should strive to protect the user.  I would say
that it violates a stronger form of the Unconfugurability Axiom and of
the Orthogonality Axiom.


> [...] In a 100-line code block that is nested five levels, this
> can be a very nice memory aid. [...]

Yes, but:
1.  It makes it easier for people to write obscure code
2.  When reading code, I have to remember to check the end-condition
to know whether a block will be executed.
4.  An obscure use of it is not self-explanatory for someone seeing
the feature for the first time.

Using ``endif'', ``endwhile'', ``endfor'', etc. would lead to better
code, because it would be simpler to read (no expansions) and always
syntax checked.  These can even be tab-completable.

Another solution is better block highlighting on the command line and
in editors. Sure, this is not as good as a better language.

> > Even the fact that a block can end in more than one way would make
> > code harder to read; for example if both ``end'' and ``fi'' end an
> > if-block.  It is better to choose one and stick to it.
>
> Absolutely. I don't consider that an option. One way of doing things...

Yes, it's only one syntax.  But the user still has lots of ways of
doing things: ``end'' or ``end if'' or ``end (obscure_function we1rd
p4ram5)''.  That's far more ways of doing things than just ``end'' and
``end if''.  Again, the point is that people can now more easily write
obscure code.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to