layout rule infelicity

Martin Odersky martin.odersky@epfl.ch
Thu, 30 May 2002 12:34:27 +0200 (DST)


 > If you look at C (& offspring), it's not the {;} that makes the code
 > readable, it's the indentation that does.  So why not acknowledge
that?

Redundancy maybe? What's wrong in having both layout and punctuation?
For instance, then you can have an emacs mode that handles the layout
given the punctuation.

I used to believe in layout, but got converted the other way round.
We used Scala, a new functional/object oriented language we design, in
a course with 100+ students. Scala used to have layout rules somewhat
like Haskell's. In our experience it was the single thing that
confused students most. Problems were: (1) Students did not properly
indent their code. (2) Students used editors that disagreed in the
handling of tabs. (3) Students wrote multi-line statements that
started at the same column.

I came away with with the learning experience that a little redundancy
in the syntax is a good thing.

Cheers

 -- Martin