3 ms·
*Lastly, some tone stuff: Function pointers have nothing to do with functional programming. And why hate on a language you haven't studied? And why does there h
by silentvoice 13y ago
*Lastly, some tone stuff: Function pointers have nothing to do with functional programming. And why hate on a language you haven't studied? And why does there have to be a TLDR version of a mind-expanding experience like learning a new programming style? ....
I'm loving Haskell and am using it for all sorts of things now. I think this confusion deserves to be addressed though. When people first spoke to me about functional programming, they would say things like: "It's a paradigm shift because everything is based on functions and functions are first class citizens, you can pass them around just like anything else"
Unfortunately this description of functional programming only makes sense to functional programmers. As a C programmer (what I consider myself primarily) I was inclined to simply say: "So what? Functions are perfectly easy to use in C and I can also pass them around provided I'm willing to stomach a little indirection, why do I need the unfamiliar syntax of Haskell to do something I can already accomplish in C?"
So I can see where the function pointer remark is coming from. It might represent a misunderstanding of functional programming, but it's a misunderstanding potentially created by uncareful exposition. In my case I was thinking exactly the same thing before I started to understand the value of FP, and having approached FP many times in the past and failed to understand the point of it, could easily lead to an attitude of: "This is needlessly complicated, time to give up."
- csense 13y ago> why hate on a language you haven't studied I've studied it well enough to understand its drawbacks. I don't understand Haskell's benefits very clearly, but I'm skeptical that the benefits of Haskell outweigh its drawbacks in the context it was being discussed. > "So what? Functions are perfectly easy to use in C and I can also pass them around provided I'm willing to stomach a little indirection, why do I need the unfamiliar syntax of Haskell to do something I can already accomplish in C?" So I can see where the function pointer remark is coming from. It might represent a misunderstanding of functional programming, but it's a misunderstanding It sounds like you understand exactly the mindset I have and the question I'm trying to ask. But you don't answer the question -- and neither does anybody else in this thread, even though obtaining an answer to this question was supposed to be the point of the original posting. I suppose rephrasing it should be: "What does Haskell accomplish with functions that passing around function pointers in C does not?" Your answer is, "Something totally different that I did not understand before I knew Haskell, and which I understood after I knew Haskell." This does not answer the question!