<div dir="ltr">I think it's important to keep in mind that the correct trade-off for one situation is not the correct trade-off for another. This is a great example! On one side of the spectrum, you've got situations where Idris or Agda are good fits, where it's critically important to know that code is correct, even at the expense of significant complexity or time. But there is another side of that spectrum. It's probably best characterized by education: there are no users, bugs that aren't found don't matter at all, and even when you know for sure that something is wrong, it would be great if you can let it fail and *watch* it go wrong; stopping someone who's learning to tell them they got something wrong before they understand WHY is bad teaching.<div><br></div><div>I've been working for years now on using (a variant of) Haskell in early education, as young as 10 to 11 years old. Looking at this experience, I agree whole-heartedly that regardless of what's best in a professional setting, there's still something about Haskell that's far more difficult to learn than Python and Java. It's not about the incidental complexity of the language, which can usually be avoided. It's about the way everything just looks so easy once it's written, but new programmers struggle mightily to figure out how to get started in writing it. People don't understand how to build things compositionally.</div><div><br></div><div>As an aside: I know it's popular among the functional programming world to hypothesize that this is because people have used imperative languages first. I can tell you, though, that the hypothesis is wrong. I spend a good bit of my time teaching students with no previous programming experience in any language. They also struggle with it, but they understand imperative programming intuitively. Mathematics teachers also know this, and it's why they so often fall back to teaching step-by-step processes instead of talking about subexpressions having meaning. Think about how you learned the "order of operations", which obviously should be understood as a question of parsing and identifying subexpressions, but is always taught as "you multiply before you add" because that's what gets correct answers on exams.</div><div><br></div><div>Incidentally, realizing this makes me more determined to teach Haskell and compositional thinking at a younger age. It might not be easy, but you don't get far in mathematics without grasping the idea of building up abstract objects through composition. This shift from thinking about "how to get it done" to thinking about "what it means" is a huge step toward understanding the world around us, and should be pretty far up on the priority list. So I'm not badmouthing Haskell here. I'm just saying we should realize that there's a very real sense in which it is legitimately HARDER to understand. No use being in denial about that.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 11, 2018 at 11:10 AM Stefan Monnier <<a href="mailto:monnier@iro.umontreal.ca">monnier@iro.umontreal.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> but functional programming is harder.<br>
<br>
There's no doubt that languages like Haskell go through extra efforts to<br>
make it *harder* to write incorrect code, and along the way they also<br>
make it harder to write code at all.<br>
<br>
So maybe it will take your guy a week to get the code written in<br>
Haskell, whereas a couple days were sufficient in Java. But that's<br>
without counting the subsequent month during which the Java code will<br>
have to be debugged before it actually works ;-)<br>
<br>
IIRC it was Bob Harper who said a good programming language should be<br>
hard to write (but easy to read, of course)?<br>
<br>
<br>
Stefan<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>