In message <[EMAIL PROTECTED]>, Derek M
Jones <[EMAIL PROTECTED]> writes
>Kevlin,
>
>>So I may have missed a posting, but what do you believe is the
>>compelling cognitive reason (as opposed to software tool reason) that
>>layout as indicator of meaning is definitively a bad idea? Or coming
>>from the other side, when -- cognitively -- is the absence of
>>indentation necessarily good?
>
>I may not have been clear in saying that I think language definitions should not
>give indentation a syntactic meaning.

It's OK, that was clear. I was after the rationale, as I do not believe
that it is a problem of human perception, although it can be claimed
that writing some software tools is simplified by free format code --
OTOH, there are some good examples where the opposite is true, eg
folding editors.

>Indentation can be a very useful visual aid in comprehending source code.

OK, we're agreed, so that means the problems caused are elsewhere.

>The dangers of having a translator treat indentation as significant, 
>syntactically,
>are software engineering ones.  Developers often cut and paste source.  It
>is not uncommon for the copied source to have a different indentation.  
>Developers
>don't always correctly re-indent the copied source.

Hmm, I am not entirely convinced of this one. I have no figures to back
it up, but personal experience has never demonstrated this to be a
problem. I am not talking about whether or not my own editing habits are
meticulous, but in general. It simply doesn't seem to happen with any
degree of significance, or rather where I've seen cut and paste problems
the problem has been with free-format languages. The code looks like it
means the right thing, but it doesn't. It is still legal, but was
dragged too far one way by a line or so. My experience with occam, and
watching others learn it, suggests that in most cases such mistakes
ended up with syntax errors rather than legal code.

I think the layout convention that seems to cause the most problems is
free-formatted pure block structure, as in C or Pascal, and is probably
fairly independent of indentation significance. Both Python-like and
Ada-like languages seem to have enough checks and balances in the syntax
to reduce copy and paste problems, such as the so-called "dangling else"
problem.

I am not sure that the defence of free format languages based on sloppy
developer habits is a particularly robust one :-) As I said before,
although the issue appears to be a religious one, I think that the
workability and defensiveness of the syntax tends to be down to many
more, sometimes overlapping, factors. It is the combination that is
important:

- pure block structure (begin-end) or per-control-statement blocks (if-
endif)
- spacing with non-functional significance or functional significance or
no significance
- words (begin-end) or symbols ({}) or spacing as block delimiters
- consistency in layout
- and so on...

Thoughts?

Kevlin
____________________________________________________________

  Kevlin Henney                   phone:  +44 117 942 2990
  mailto:[EMAIL PROTECTED]     mobile: +44 7801 073 508
  http://www.curbralan.com        fax:    +44 870 052 2289
  Curbralan: Consultancy + Training + Development + Review
____________________________________________________________

- Automatic footer for [EMAIL PROTECTED] ----------------------------------
To unsubscribe from this list, mail [EMAIL PROTECTED]  unsubscribe discuss
To join the announcements list, mail [EMAIL PROTECTED] subscribe announce
To receive a help file, mail [EMAIL PROTECTED]         help
This list is archived at http://www.mail-archive.com/discuss%40ppig.org/
If you have any problems or questions, please mail [EMAIL PROTECTED]

Reply via email to