5 ms·
The article addresses a real problem. Haskell is presented by its neophytes as some uber-arcane thing that cannot be understood by a mere average programmer, yo
by a-nikolaev 12y ago
The article addresses a real problem. Haskell is presented by its neophytes as some uber-arcane thing that cannot be understood by a mere average programmer, you have to learn algebra first!, and read all Martin-Lof, and whatever else. And it hampers adoption of the language by many other people who might be offended by such superiority attitudes.
However, it is much healthier to present Haskell as simply a tool for writing better and safer code, which is frequently easier to reason about than your conventional for-loops all the way down. So everyone should try it, and say for themselves.
I may be wrong and over-generalizing here, but Haskell is a very convenient vehicle for showing off and belittling others. And honestly, who does not want to stick Haskell somewhere in their CV just to look better nowdays? Being fancy has a cost for the language. This is not an intrinsic fault of Haskell. People just need such a thing. If there were no Haskell, we would have APL, Lisp, Erlang, C++, or something like this.
- VMG 12y agoBut isn't it also a mistake trying to portray Haskell as just-another-langauge? It clearly is not, it is more difficult to learn. Like with most things in life, the benefits appear after putting a lot of effort into it. I don't get the impulse to portray Haskell as "easy". The perceived arrogance of Haskellers may also come from that. You don't defuse arrogance by saying "Look, I'm not smarter than you. This is easy. Now let's talk about Monads, they're just like Tacos. I'm patient." Better be honest and say "Look, I'm not smarter than you. This is hard. We need to start with data types, and the benefits won't be obvious until long down the road."
- a-nikolaev 12y agoGood point. Programming should be explained at the right pace, and in rather small digestible chunks. Then Haskell is not harder than anything else. The basics of Haskell are very easy actually. Function is just a function, it maps values and you can call it recursively. And then, advanced topics are hard in any big language, and in my opinion C++ is the queen here, yet it's taught to freshmen in some schools.
- BrandonM 12y ago> Better be honest and say "... This is hard...." This I disagree with. Telling someone that something is hard before you teach it to them is a self-fulfilling prophesy. My wife is a native Russian speaker, and she is slowly teaching me Russian. I struggle when learning new languages, so it's easy for me to get discouraged when the progress seems too slow. My wife often teaches me a few words at a time, and without fail, when she says, "This word is hard," before teaching it to me, it takes me the longest to learn those words.[0] It's like my brain, upon hearing that something is going to be hard, assumes that I'll forget it anyway, and simply turns off.[1] If you are getting ready to teach a difficult topic, perhaps spend a little more time beforehand trying to find good analogies and approaches. Oftentimes, a topic's difficulty melts away when a student can make an appropriate connection. Don't confuse the difficulty of teaching a topic with the difficulty of learning it. [0] You might argue, "Those words probably are harder." That's a fair point, but in the hours before our wedding, I managed to learn how to say, "Я знаю что я никогда не буду голодным. [I know that I will never be hungry.]" On the other hand, it took me days to learn, "карандаш [pencil]" after she told me it was a hard word. [1] When I recognized this phenomenon I asked her to please stop telling when she expects something to be hard.
- VMG 12y agoIt is important to set realistic expectations. The popularity of different programming languages is note purely random or an historical artifact. Some languages are easier to learn than others. If a student struggles to grasp an "easy" concept, she might give up prematurely. I've witnessed this a lecture: the Professor tries to sell Haskell with the dreaded quicksort one-liner. In my opinion, that's the classic show-off example where it's easy for somebody who knows Haskell but hard for somebody who doesn't. Most of the class thought "obviously this is beyond my capabilities" and tuned out. Of course, students should also know that hard problems are overcome by effort, not intelligence. I know the effect you're talking about, but it is a good habit to consciously not try be discouraged by hard problems.
- reflexer 12y ago"dreaded quicksort one-liner" - nice meme here
- kmicklas 12y agoI think it is anything but clear that Haskell is harder. What may be clear is that functional languages are harder to learn for people who have already learned imperative programming. But then you're forgetting the massive time investments they already made in that style. Having TAed intro classes at a university, I can say from experience that new students pick up functional style much quicker and are always confused by mutation until they've had a fair amount of experience with it.
- yawaramin 12y agoHaskell goes way beyond just functional programming. Most of the interesting stuff is happening in the types: monads, applicatives, lenses, etc. And when you're trying to understand something like: FooT w (BarF x) Baz y z a ... it can seem a tad difficult.
- dragonwriter 12y ago> But isn't it also a mistake trying to portray Haskell as just-another-langauge? It clearly is not, it is more difficult to learn. I don't think it is. I think (as is the case with functional languages and languages with non-Algol-inspired syntax generally, and Haskell falls in both groups) Haskell is harder to learn as an N+1 language than an imperative language with Algol-inspired syntax if you are a programmer whose existing familiar is with N languages that are all imperative languages with Algol-inspired syntax, for N > 0 (and this is increasingly true with increasing values of N.) If you've got some background in functional languages without Algol-inspired syntax (e.g., Lisp) and some background in statically typed languages (even imperative, algol-inspired ones) it doesn't seem to be fundamentally that hard to learn, though. I think that there is something of a deficiency in that there isn't a lot of good tutorial documentation (at least, that I've seen) for Haskell that is well designed either for new programmers or for experienced programmers without a background in things like category theory, but AFAICT that's not anything fundamental about the language, but more something about where it came from and who the early audience was. As Haskell seems to be getting broader attention, I expect that will improve.
- VMG 12y agoThe syntax is not the issue, the very sophisticated type system is.
- dragonwriter 12y ago> The syntax is not the issue, Syntax differences very clearly are a source of difficulty for many people learning new languages, especially when there experience is focussed on a particular syntax style. > the very sophisticated type system is. I don't see any evidence that Haskell's type system makes it harder to learn from an absence of programming knowledge. Like its non-Algol syntax, it probably makes it harder for experienced programmers with habits centered around patterns learned in less expressive static type systems or un-/dynamically-typed languages. If anything, I think the consistency of the type system and the relative lack of ceremony probably makes it easier, in some ways, than C/C++/Java family languages, where there is lots more type ceremony to learn.
- Dewie 12y ago> The article addresses a real problem. Haskell is presented by its neophytes as some uber-arcane thing that cannot be understood by a mere average programmer, you have to learn algebra first!, and read all Martin-Lof, and whatever else. And it hampers adoption of the language by many other people who might be offended by such superiority attitudes. I don't know how that, specifically, comes off as a superiority thing. Does it have to do with delivery? I mostly see opinions ranging from "knowing category theory is pretty useful, but not essential, in order to program in Haskell" to "Learning things like category theory is only useful for a Haskell programmer in certain circumstances and/or domains". Are things like that signs of a superiority complex? There might be many who write these kinds of things, only with a condescending delivery. I guess I just haven't seen much of them, myself. Or is the problem that the topics are theoretical in a mathematical way? Those things seem to have a stigma when applied to certain concepts. I mean, programmers seem very free to discuss theoretical ideas and concepts as much as they like without anyone complaining. But as soon as the topic shifts to some abstract branch of mathematics, people start thinking that they are just intellectually masturbating. Haskell is bourne out of certain theoretical branches of mathematics. So when someone says "in order to understand the point of this typeclass, let's review some abstract algebra ...", it's like someone in a C tutorial saying "in order to understand how arrays work, let's look at how the computer memory works ...". I mean, C is very closely inspired by how the machine "really works" (or used to work, or whatever; consult your nearest expert on computer architectures for less hand-wavy remarks on the subject). So it includes topics like machine models in order to argue how programs work and are correct, in the same way Haskell chooses to involve algebraic properties in order to argue that you really can write `a ++ (b ++ c)` instead of `(a ++ b) ++ c`, and vice versa. > And honestly, who does not want to stick Haskell somewhere in their CV just to look better nowadays? Uh, me? Whenever someone asks me what my favourite programming language is, I don't swell with pride when I say Haskell; I feel sheepish and awkward. Huh, what is that? People might very well think that I'm just a programming language geek who "doesn't know how to get anything done" (which isn't too far from the truth), instead of thinking that I'm some programming genius. But like it is with music and other stuff, I have peculiar interests and tastes, which often doesn't mix too well with other people's interests and tastes. Sometimes I wish that I had slightly more "pragmatic" interests rather than being such a idealist. But it is what it is, I guess.