5 ms·
Huh... weird, I don't really think of currying as much of an abstraction. I mean, if you're going to be rigorous about it, maybe, but you can cheat and explain
by zzalpha 12y ago
Huh... weird, I don't really think of currying as much of an abstraction. I mean, if you're going to be rigorous about it, maybe, but you can cheat and explain it as partial function application, which gets you 99% of the way there, and I think is pretty easy to explain.
Higher order functions are certainly a bit trickier, but you could explain them in specific contexts (as with 'map') without needing to deal immediately in generalizations, which probably makes it a lot easier to explain.
- platz 12y agoI assume then you'd expect him to learn about polymorphism, inheritance, classes, the 'static' keyword, and virtual functions if this was an OO language, if these kinds of things are on the table, right? I'm sure there aren't truckloads of evidence of beginners having problems with those concepts.
- chowells 12y agoIn all honesty, inheritance, classes, the 'static' keyword, and virtual functions are all harder than anything in Haskell. They're all weird ad-hoc concepts without simple underlying mathematical concepts. That's rather unlike Haskell, where the underlying math is usually very simple, if more abstract than most people are used to.
- seanmcdirmid 12y agoThat is very subjective. For example, Lisp has a very simple grammar, yet many people find the minimalism complicated in how it manifests in paren heavy code. Likewise, Haskell's reliance on abstract mathematics is definitely going to turn many people off to it. "It's just math" is often taken as a negative, not a positive (depending on the person). Natural language is built around all sorts of non mathematical ad hoc concepts, yet we seem to use it just fine. Of course, it might not be the best way to talk to the computer, but it is definitely "accessible."
- coolsunglasses 12y agoThere's no abstract mathematics in the casual Haskell user's experience. I have no education, no background in math, self-educated or otherwise and use it effectively and happily for industrial purposes.
- seanmcdirmid 12y agoProgramming in Haskell is as close to math as one can get in a general purpose programming language (theorem provers are more so, but not general purpose). You might just have a knack for it even without formal training.
- coolsunglasses 12y ago>You might just have a knack for it even without formal training. Nah, I've attempted some real math with a tutor, I'm quite bad at math and proofs :) No skill or background needed with such things for Haskell.
- jesstaa 12y agoMost people don't know their natural language as well as they'd need to know it to accurately and unambiguously describe things. The only reason natural languages are even useable is because the human interpreting them has a huge amount of context to infer the meaning from and do error correction with. The reason programming languages exist is to simplify the language used to describe things so they can be interpreted without too much additional context and unambiguously.
- seanmcdirmid 12y agoYou aren't wrong. But there is a good reason objects remain popular even if they aren't ideal by any means. With objects, you get to rely on your built in metaphor capabilities of natural language, your ability to think ad hoc. Now, that gets you into trouble quickly because the computer isn't human, but it shouldn't be a big mystery why OO remains popular. Haskell makes imprecise ad hoc thinking hard to encode, because well..eat your vegetables, they are good for you!