Ask HN: What are specific tangible benefits of learning Haskell?
I've worked in C/C++ for many years and recently started trying to learn Haskell. As many new people learning Haskell, I am running into issues with not just the quality of learning material but the general attitude of members of the Haskell community. For example, when asking for an explanation of a particular topic recently, I received a barrage of insults about how annoying it is for people to be asking such questions, short unhelpful answers without explanation, a near constant refrain of "ask this question on IRC" because apparently people cannot be bothered to answer questions outside of there, answers which do not actually answer the question raised, various forms of pats on the head and patronizing "You go ahead and think that, Timmy. You'll soon see how wrong you are" styled answers, etc., etc., etc. Some members of the community have been nice but the more abrasive members have left a sour taste in my mouth. Is anyone ready, willing, and able to provide clear and concise explanations of specific tangible benefits of learning Haskell? I've spent almost 6 months trying to learning the language and I really don't feel like wasting another 6 months if it's not worth the effort in the end. If making objectively verifiable arguments, like "functions are more concise", please provide proof of claim.
34 comments
[ 3.6 ms ] story [ 55.2 ms ] threadLearning Haskell adds to the mass of things you know, and the volume of that mass determines the level of your general expertise.
You asked for tangible things, but it's harder to see what those may be. Perhaps your perception will be enhanced: perhaps you will better see and care about side-effects, opportunities for pure functions, etc.
I don't think any learning effort that leads to increased knowledge can be a waste of time.
So: "Is Haskell worth learning?" Yes, certainly. "Is learning Haskell the best use of my limited time for such activities?" That's a much harder question.
(And it doesn't have to be the best use of your time. It could be close enough that it's not worth the time looking for something better.)
That said, I appreciate your calling it out specifically (even if I'd have used other words), as that is absolutely the real question.
My answer, I'm sure you'd guess, is "yes" - but certainly I agree that it's harder than the same question but ignoring the costs :-P
When it comes to Haskell, there is a big problem that the people best qualified to speak on the matter have invested a lot of time in Haskell, and therefore are subject to biases associated with their investment in the field.
For one thing, I would ask what programs use Haskell. The only major project I'm aware of is xmonad. This should tell you something about how practical Haskell is.
On the other hand, you may learn something from Haskell. I studied Haskell because I believe there are much better languages out there, and in order to find them we need to understand and improve on the theoretically most advanced languages (i.e. dependently typed languages) and learning Haskell was the best starting point. If this is not your goal, I actually doubt another 6 months of Haskell will help your day to day programming.
Also, what have you managed to learn in the past 6 months? And how were you studying? I found Learn you a Haskell to be the best introduction.
As far as what I have learned and how I have been studying, I did try "Learn You a Haskell" but found its explanations inadequate and sometimes confusing. Searching the web, I find a number of people feeling the same. Meanwhile, I find a large number of people agreeing with your experience the text is the best introduction. I think the fact the supposed best text is utterly failing a sizable number of people also suggests how worthwhile Haskell might be.
I think it says a lot more about the fact that learning (and, therefore, the best text for learning) is highly subjective than it does about the worth of Haskell.
I mean, how does the logic even work that leads from "some people think that this text is good for learning about X but I find it is 'inadequate and sometimes confusing' to me" to "X isn't generally worthwhile" even work?
I'm pretty sure I did not make that particular claim. I have trouble learning from the supposed best text; others have trouble learning from the supposed best text; asking questions gets me treated with hostility and non-helpfulness. I want to know what I am going to get out of learning the language if I put additional time into it. If I am not going to get any more from Haskell beyond (a) what I already know in C/C++ and (b) the ability to put Haskell on a resume, the question of cost/benefit analysis arises quite quickly.
If you're comparing your progress to some of the more advanced programs out there, you'll certainly get demoralized. But if you're having trouble with just the stuff in LYAH, then maybe Haskell isn't your thing? 6 months is a good long time to spend on learning something, so I'm pretty sure your gut instinct knows what's best for you.
Let me rephrase: I think that there are much better languages out there, that haven't been invented yet. The most theoretically advanced languages right now are dependently typed languages. Haskell isn't a dependently typed language, but learning Haskell is a necessary stepping stone to learning dependently typed languages.
Regarding LYAH, it's not really possible for me to comment given how little data I have. I know some CS courses for undergrads teach Haskell, I wonder what textbooks (if any) they use?
Also, if you haven't been getting traction with the #haskell IRC channel, try the #nothaskell channel. The title is a little confusing (it should be called something like #notjusthaskell), but they try to be more helpful there than the regular #haskell generally is.
You may also want to check out this recent post about the quality of various haskell resources: http://bitemyapp.com/posts/2014-12-31-functional-education.h...
Do you have nay experience with the #haskell-beginner channel and knowledge about the degree of helpfulness there compared to #nothaskell?
I will check out the link; thanks a bunch!
If you could privately forward me links to some of the examples of behaviour that discouraged you I would appreciate it. I spend a lot of time on /r/haskell and am keen to keep it an encouraging place for new visitors.
My email address is here: http://web.jaguarpaw.co.uk/~tom/contact/
I think that Haskell's strangeness harms it in two ways. One it puts off people because the superficial strangeness takes some getting used to. More dangerously it makes a small fraction of Haskell programmers dangerously arrogant. They feel that just because they are now familiar with this strange jargon they have become superior to the users of other languages. Depending on temperament this turns them into snobs or evangelists.
I don't think there is any concrete evidence of Haskell's superiority as a practical tool. Programs like pandoc, darcs or xmonad are great but there is no proof (and as far as I know neither have their authors claimed) that they were easier to develop than comparable programs in imperative languages (TeX, git?).
Much better is the attitude of Haskell leaders like Simon Peyton Jones who present Haskell as a ongoing research project with its set of successes and unsolved problems: http://research.microsoft.com/en-us/um/people/simonpj/papers... http://research.microsoft.com/en-us/um/people/simonpj/papers...
But it turns out that you can live in the IO Monad and just write Haskell as if were a strongly-typed kind of Python, and quickly get to the point where you are doing something useful, and benefiting from the type system and lazy evaluation (e.g. being able to define an infinite list then just consume as much of it as you want) and the nice syntax for pattern matching, and so on. Then you can gradually add in more and more Haskell concepts as and when a) you feel ready and b) you encounter situations where they'd be useful.
Jumping straight in with monads is the wrong way to do it (and monads are actually easy if you let them sneak up on you rather than trying to chase them, like cats) and the monad tutorials you find on the web are all written by idiots who think they a lot cleverer than they are. Burrito Spacesuit guy, I'm looking at you.
What I'm saying is, don't let a minority of the community put you off. The "conventional wisdom" on how to learn Haskell, is wrong.
https://github.com/facebook/pfff/wiki/Main
http://frama-c.com/
I'm a Haskell newb as well (write apps in Java for daily living). I'm quite interested in theoritical CS, and that's what keep me pursuing Haskell.
If you ask me what specific benefits I get, then my answer is none. At least at the moment.
I'm a Haskell newb as well. Learning it because I'm interested in theoritical CS (category theory, type system, etc).
If you ask me do I have any benefits of learning Haskell, then my answer is no. At least for the moment. But that doesn't stop me from pursuing it.
Of course, your mileage my vary... :)
The first is Lisp.
The second is Haskell.
Lisp taught me, essentially, that most of what I'd been doing in other languages was unnecessary tedium, and introduced me to the functional style for the first time.
Haskell taught me that even some of what I was doing in Lisp was itself unnecessary tedium, and that things like typing that I'd found tedious in other languages, could actually work to my benefit. Even though I still don't code in Haskell as my main language, it made a functional believer out of me, and still affects my coding style and the design projects I've done since.
As for 'objectively verifiable', well, go look at most any equivalent program in Haskell or Lisp to one in C or Python and just compare how many code lines it takes to do the same work. All the 'design patterns' and 'constructors' and costly looping constructs and everything else falls away for so much tedious bullshit when you get your hands on a language with proper functional tools. And the benefits to sanity of writing in a state-free style are literally the reason I left purely imperative languages behind.
Even the best, least tedious code I see in imperative languages usually comes from people who've had experience in functional languages: probably my favorite Python programmer to read is Peter Norvig, because his Lisp background shows through even in his Python code. This is why people say over and over again that, even if you never touch a functional language again, it's still good to learn at least one, because it will improve the way you code and how you think about functions and composition of same.
I can hack something together quickly cutting corners if needed, then refactoring is easy and almost always works on compile when you get around to fixing things up.
You will want to code using more elegant, more composeable and succinct, methods. You will want to break things down into small, provably correct units, and then combine them into larger solutions which take advantage of the proven correctness at the lower levels.
You will want to lean heavily on the type system and encode as many of your program constraints in there as possible, leaving your unit tests free to only deal with the logic of your code.
Even if you never write a piece of Haskell code again, you will find over time that more and more ideas from Haskell and similar languages are bleeding through into the languages you use. C++? Closures, optionals. C#? LINQ (monads). Obj-C? On the path to retirement, replaced with Swift. Java? Lambdas, optionals. Clojure? Typed Clojure. Scala? Scalaz. In fact, Swift? Swiftz. JavaScript? People are building entire functional languages (and reactive frameworks) on top of JS.
These things aren't happening by accident. Haskell is a fertile proving ground for the future of programming.
I apologize on behalf of the Haskell community for any harsh treatment that wasn't deserved, and I wouldn't be surprised if there was some - the tone does seem to have shifted unfortunately.
What were the questions you had, and where did you ask them?