comp.lang.ada
 help / color / mirror / Atom feed
From: Paul Rubin <no.email@nospam.invalid>
Subject: Re: Haskell, anyone?
Date: Wed, 18 Nov 2015 01:23:08 -0800
Date: 2015-11-18T01:23:08-08:00	[thread overview]
Message-ID: <87ziyblkzn.fsf@nightsong.com> (raw)
In-Reply-To: b6f252a0-1dbe-4b65-b1f3-df591df27567@googlegroups.com

Hadrien Grasland <hadrien.grasland@gmail.com> writes:
> My message was about the fact that a program with recursion is about
> as hard to read and understand as an old-fashioned program featuring
> gotos. Actually harder...  Your counterpoint was that recursive code
> is easy to *write*,

I don't find the recursive version harder to read.  In the goto version,
the variable is changing while the thing runs, so at one place it's 5
and at another place it's 4, and I have to keep track of that, and it's
potentially exponentially worse when there's more than one variable
changing.  In the recursive version, the values don't change.  Yes you
have to be aware of possible stack consumption but that becomes second
nature, and there are also tools that can monitor your code for space
consumption to catch any problems.

> readability and ease of writing are different goals, which are often
> at odds with each other. I believe they are in the case of loops vs
> recursion.

It's probably mostly a matter of what you're used to.  If I look at a
Swedish web page and can't understand much of it, that's because I don't
know the language, not because of the style or ideas in it.

> And I believe there is also such a usability compromise at work when
> you need to give up on data structures which everyone knows about, and
> use more sophisticated and obscure ones, because your programming
> language does not support very well the conventional abstractions.

Again it's a matter of what you're used to and what you consider
conventional.  There are some intro classes being taught with Haskell
and ML these days, and SICP back in the day used Scheme in
mostly-functional style.  If you're writing concurrent programs you
should know about those immutable structures anyway.

> So far, my impression is that in the philosophy of functional
> programming, it is okay to sacrifice readability and make the life of
> newcomers harder by using highly sophisticated abstractions even when
> they are not strictly necessary,

I'd say Haskell is at the high end of the sophistication scale for
general-purpose languages, so that critique applies more to it than to
(say) Scheme or ML.  But IMO that sophistication also makes it the most
enlightening for programmers trying to expand their technical range.
Ocaml may be more practical and I want to try using it sometime.

> Personally, I am quite obsessed with the idea that my code might be
> read by someone else someday, including the person I'll be in 20
> years, so I tend to put readability fairly high on my priority list
> when I program something. 

Haskell is pretty readable if you know the language, especially if you
write good comments.  It's not COBOL but you really probably don't want
it to be.  One issue though is that the language keeps changing.  SML is
basically frozen and I guess that has attractions.

>"Try to use the simplest abstraction that will work well" is an
>important principle for me.

Sure, that makes sense.

  reply	other threads:[~2015-11-18  9:23 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15 20:42 Haskell, anyone? mockturtle
2015-11-15 20:51 ` Paul Rubin
2015-11-15 20:53 ` Nasser M. Abbasi
2015-11-15 21:50 ` Mark Carroll
2015-11-15 22:11 ` mockturtle
2015-11-15 22:48   ` Nasser M. Abbasi
2015-11-15 23:05     ` Mark Carroll
2015-11-16  4:11       ` Paul Rubin
2015-11-16  5:17         ` Nasser M. Abbasi
2015-11-16  5:48           ` Paul Rubin
2015-11-16  5:59             ` Nasser M. Abbasi
2015-11-16  6:47               ` Paul Rubin
2015-11-16  8:45           ` Simon Wright
2015-11-16 14:38             ` Brian Drummond
2015-11-15 23:19     ` Jeffrey R. Carter
2015-11-16  9:36       ` J-P. Rosen
2015-11-16 18:14         ` Jeffrey R. Carter
2015-11-16  3:59   ` Paul Rubin
2015-11-16  8:33   ` Dmitry A. Kazakov
2015-11-16  9:33     ` mockturtle
2015-11-16  9:45       ` Paul Rubin
2015-11-16 10:25 ` Hadrien Grasland
2015-11-16 11:19   ` Simon Wright
2015-11-16 11:25     ` Hadrien Grasland
2015-11-16 13:59   ` G.B.
2015-11-16 20:24   ` Jeffrey R. Carter
2015-11-16 23:23   ` Paul Rubin
2015-11-17  8:26     ` Dmitry A. Kazakov
2015-11-17  9:10       ` Mark Carroll
2015-11-17 20:09         ` Dmitry A. Kazakov
2015-11-17 10:49     ` Hadrien Grasland
2015-11-17 12:01       ` G.B.
2015-11-17 16:43         ` Hadrien Grasland
2015-11-17 18:04           ` Paul Rubin
2015-11-17 21:42             ` Hadrien Grasland
2015-11-18  4:36               ` Paul Rubin
2015-11-18  8:48                 ` Hadrien Grasland
2015-11-18  9:23                   ` Paul Rubin [this message]
2015-11-18 10:44                     ` Hadrien Grasland
2015-11-18 11:02                       ` Dmitry A. Kazakov
2015-11-18 12:41                         ` G.B.
2015-11-18 23:06                       ` Randy Brukardt
2015-11-19  8:56                         ` Hadrien Grasland
2015-11-19  9:19                           ` Hadrien Grasland
2015-11-19 21:27                           ` Randy Brukardt
2015-11-24 12:03                           ` Jacob Sparre Andersen
2015-11-19  7:22                       ` Paul Rubin
2015-11-19  9:39                         ` Hadrien Grasland
2015-11-17 13:01       ` Thomas Løcke
2015-11-17 16:45         ` Hadrien Grasland
2015-11-18  0:11       ` Paul Rubin
2015-11-18  9:44         ` Hadrien Grasland
2015-12-06 12:59   ` David Thompson
2015-12-07  7:25     ` Hadrien Grasland
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox