Hacker News new | ask | show | jobs
by Enzolangellotti 4072 days ago
Would you advise Haskell to someone who has just started programming (working on Learning Python the hard way) and is interested in learning mathematics (from the high school level onwards)?

P.S. I want to study algorithms too but I'm just a beginner and the priority is mathematics (as it's one of the few subjects I seem to be able to concentrate on). I found a secondhand copy of Professor Sedgewick's book for ten euros, it's the manual for one of his MOOCs , should I go with it?

5 comments

Haskell is an amazing language. I've only spent a brief amount of time with it, but I've seen what others can do with it, and I'm very impressed.

That said, I don't know that I'd recommend it to someone who has just started programming. I think that it'd be harder to appreciate it, since a lot of the rules that Haskell breaks / puts in place aren't things you've run into too often.

I'd recommend becoming at least relatively familiar with normal programming paradigms and then giving Haskell a go. It certainly deserves your time, but without proper appreciation of what exactly it does, I think its unforgiving nature could become discouraging.

edit: Of course, if you find normal paradigms boring / uninteresting, Haskell may be just the place for you. It's also really, really good for mathematic applications.

Haskell is very well suited to mathematically oriented minds. Such people, I believe would fare even better with Haskell than they would with Python.
Thank you, I guess trying won't hurt, nobody has ever regretted learning anything after all. As for feeling discouraged, being stupid (in various degrees) is part of the learning process I believe. Couldn't say I'm learning anything otherwise. I will try Haskell alongside Python to see how it goes.
If you don't mind feeling stupid, Haskell will be very well suited for you. :)
Don't worry, I've been living with the feeling for a long time ;)
What kind of mathematics do you want to learn? If you are interested in discrete mathematics and algebra, Haskell has something to offer. I would also read http://www.amazon.com/Conceptual-Mathematics-First-Introduct... which is a great introduction (unspecific to code).

If you are more interested in linear algebra or numerics, I would suggest to get to know numpy better.

Thank you! I fond the sneak peeks of number theory, algebra, probability, combinatorics and graph theory I've had so far to be quite enjoyable. But keep in mind my run with geometry hasn't gone past Euclid (the illustrated version of the Elements edited by Taschen) and I'm still in the dark about other fields (I'm using Professor Gowers' The Princeton Companion to Mathematics for direction).
Haskell as a language is suitable for beginners, but most of the learning material assumes some familiarity with other languages.

I've been teaching a bit, and what worked was to start with Racket on How to Design Programs (http://www.ccs.neu.edu/home/matthias/HtDP2e/part_prologue.ht...) for a while and then switch over to Haskell material, like Learn You a Haskell.

Racket is a great language too in itself, and has terrific material for beginners.

Amazon keeps recommending Realm of Racket (No Starch press). I'm checking your link and finding it useful, thank you!
How to Design Programs is awesome, but really very slow and pedestrian later. Feel free to either skim or switch to another book once you outgrow it.

Definitely, do all the exercises in any programming book you are trying to learn from. In some sense, the exercises are the meat of any such book, and the rest is just supporting material.

Some people even start a new chapter with a look at the end-of-chapter exercises, try their hands at them for a few minutes. They'll most likely fail, but one gets a better perspective of what to watch out for in the chapter.

Yeah, in a certain sense it's a lot like mathematics. You try your hand, perhaps you get it right the first time, more often than not you don't but at least you learn something out of it.
FWIW Hudak's Haskell School of Expression was the first programming book I ever read, and probably the reason I do programming today.
I just checked a public library nearby and it occurs they might have a copy, thanks for the suggestion!
I imagine a lot of Haskellers would tell you yes. They love an opportunity to tell people who great Haskell is for anything. I'm not saying it's not in this case (I really have no idea) but I'm sure many would.
Haskell is different. If your experience is limited to imperative OO languages, you will learn lots of useful things with Haskell.

That alone justifies going out of your way to learn it.

It's the one true faith!