Re: layout rule infelicity

[redirected to haskell-cafe] Ashley Yakeley wrote (on 30-05-02 03:18 -0700):
At 2002-05-30 02:54, Lennart Augustsson wrote:
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?
In C, the indentation is an important visual clue, but there are many different indentation styles.
I think there are not so many different _indentation_ styles. The differences seem mostly to revolve around where to put _the braces_. And one might argue that the reason for that is precisely that it's so arbitrary, since the indentation is the main visual clue to structure anyway. Personally, I always try to factor out arbitrariness from my programs. I think layout does the same thing for syntax.
If you're used to braces, complicated Haskell expressions with layout look confusing, since it's not immediately clear which indentation style the layout rules are trying to enforce.
If you're used to C, then layout and indentation will be the least of your difficulties when you start using Haskell... Anyway, I have the feeling that, for every person on this list who complains about layout being unintuitive, there are 10 people who would say the opposite. Shall we take a poll? -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379

On Thursday 30 May 2002 13:43, Frank Atanassow wrote:
Anyway, I have the feeling that, for every person on this list who complains about layout being unintuitive, there are 10 people who would say the opposite. Shall we take a poll?
It's not unintuitive, it's counter-intuitive. :) The errors resulting from
layout mistakes are hard to spot and are annoying.
On the other hand, it has a blend of intuition. If you are writing in a
certain, not-so-clear-what style, it makes life easier. :)
As you can see I've contradicted myself.
** Type error.
--
Eray Ozkural (exa)

Just to add my voice to the din... I come from a c/c++/java background, and I taught myself haskell. The layout rules were the part I had the least problem with. I'd prefer that if any change is made it's one that adds options, not removes them. I'm confused as to the source of the problem, anyway - if you don't like the layout rules, use braces and semicolons and ignore them. Abe
participants (3)
-
Abraham Egnor
-
Eray Ozkural
-
Frank Atanassow