Hacker News new | ask | show | jobs
by oggyhead 3175 days ago
Having learnt Haskell as my first programming language, sure it has a high learning curve but it pays off in so many ways. It is without doubt the most beautiful language ever conceived. Without doubt it is the right language to unlearn imperative bs and the right language to learn functional programming principles. Even against the likes the of lispy langs and other ml flava, Haskell reigns supreme with it's purity
3 comments

It's the most "beautiful", and It's the most "pure" are probably reasons 99 and 100 on a list of priorities when choosing why a beginner should learn a language. Those reSons are reasons for people instilling why others want then to learn that language, not why it's the best for them to learn.
"It's the most pure" is a perfectly good reason to learn a language if you are trying to learn the concept about what the language is pure.

Of course, that completely flies in the face of an education system oriented towards training hordes of non-thinking peons into start positions at the job market. So, yes, it's not for everybody.

The question is about learning functional programming, Haskell forces you to learn much more than that to use it. Functional programming should be taught in something like Scheme, which lets you focus on the functional without being forced to also deal with a crazy Hindley-Milner type system that has nothing to do with functional programming. Haskell is not the right language to learn functional programming in, it's not the right language to learn anything in, beginners should start in easier languages.

> It is without doubt the most beautiful language ever conceived.

Only if you're a masochist.

Quite honestly, I feel if you think Haskell's beauty is somehow in any way associated with masochist mindset , you most likely think Maths is associated with a masochist mindset and (assuming math defines reality) the true nature reality is only viewable to those with a masochist mind. Then friend, I truly am a masochist
Yep :). I don't agree math defines reality however; it can describe reality, it doesn't define it.
I'd say Haskell is the right language for mathematicians to learn programming. Purity and laziness make Haskell definitions almost indistinguishable from mathematical ones; that means that the functional part of "functional programming" will come easy and you can focus on the "programming" part instead.
I'd agree.
It’s probably hard to see it this way when you’re starting out (and you may need a certain personality type as well =) but for me, programming in Haskell is a genuine pleasure because it’s so easy to express yourself in it. Things that require a huge amount of code in other languages are effortless and elegant in Haskell, and the compiler is extremely effective at finding mistakes in your code and often even your design, so you start treating it as a partner that helps you write your program. The experience always puts a smile on my face. YMMV, of course.

I do suspect that in the near term Idris may overtake Haskell as my favorite language to program in, though. I haven’t had a chance to sit down and learn it yet, but everything I’ve read about it so far has left me very excited.

I'd argue you're conflating simple with easy; the code might be simple, but I'd wager given the inability of Haskell'ers to even explain what a monad is successfully, that few would find it easy.
It has a shallow learning curve, if you use the term correctly. The graph of the amount that you have learned rises gradually over time.
It has a much wider learning curve than any other language I've met. You just keep learning, and learning, and at no point you feel like you master it.

Yet, it also has a much higher learning curve than any other language I met. As you learn and learn, your productivity improves again and again.

The learning curve also starts from a very low point. Without a few key concepts (no, not monads) the language is almost unusable.

The same could be said for something like Perl, where code gets a reputation for being only readable if you wrote it yourself because no two people know the same subset of the language.

That is probably an exaggeration, but it's definitely a problem you see in large complex languages with multiple ways to accomplish any particular task.

Haskell is typed lambda calculus and an amazing amount of syntactic sugar. One of the ten or so "aha!" moments of learning Haskell is realizing that so much of the language boils down to just \x -> let {...} in case {...}.

Which probably wouldn't be a bad way to teach Haskell, perhaps -- once one gets the general underlying form, understanding the rest is mostly just learning how the rest maps to that form.

No, it's completely different from Perl.

The core of Haskell is not that complex (although there is a lot of complexity on extensions). All the learning is in how to apply it, not on understanding the thing.

It is like OOP development practices, but wider and higher.

Perl, the only language where mashing the keyboard randomly has a 50% chance of working. I have looked at some of my old Perl and long-since offered my formal apologies.