I am not so much scared by functional programming as I am annoyed by functional programmers. I feel that they often come over like mathematics professors that just fill the chalkboard with lightning speed and look at you like "seriously, how dare you ask this dumb question". They go ahead explaining to you how your language is crap for all its sideeffects, smugly explaining how their language doesn't have those and then explain to you how Simon Peyton Jones shoehorned them into haskell with a monad. Also you always appear to fail to understand monads and they always fail to explain in an understandable way (although they're not that hard to get).<p>Functional programming is great and feels right, I am amazed how knowledge of fp affects my js, C# and Python up to this day. But from a social perspective: Loose the smugness, and then we'll talk fp.
Smashing Magazine on functional programming, getting most of it wrong. This is the very moment functional programming jumps the shark.<p>It's too mainstream for me now, I'll have to switch to reactive programming.
If you're interested in FP in javascript, you should check out the relatively new Ramda.js [1]. It switches from the underscore style collection first call pattern to a collection last pattern and automatically curries its functions. The combination allows for easier function composition.<p>[1] <a href="https://github.com/CrossEye/ramda" rel="nofollow">https://github.com/CrossEye/ramda</a><p>More info on the topic:<p><a href="http://fr.umio.us/why-ramda/" rel="nofollow">http://fr.umio.us/why-ramda/</a><p><a href="http://www.youtube.com/watch?v=m3svKOdZijA" rel="nofollow">http://www.youtube.com/watch?v=m3svKOdZijA</a><p><a href="https://speakerdeck.com/raganwald/javascript-combinators" rel="nofollow">https://speakerdeck.com/raganwald/javascript-combinators</a>
"Don't be scared" rhetoric is generally used to promote arguments not primarily through logic, but by painting the audience as fearful luddites, scared of progress and the inevitable better future based on whatever the speaker is advocating. The goal is to encourage the listener to convert to the new religion or paradigm, or be considered backwards, behind the times, and ignorant or stubborn. It's an effective tactic because any push-back is pre-framed as evidence the listener is among the ignorant backwards people.
I'm not scared. It just does not make sense to me.<p>Just because I speak French and English fluently does not mean I can speak Japanese. My wife is Japanese, and speaks it fluently. We've been together 19 years. I've tried to learn. it just does not make sense. It would be nice, because I have relatives there, and I could go live there, legally, but it just doesn't make sense in my brain.<p>What can I do?<p>Functional programming is the same. Every couple of years I take a look, and I recoil in confusion.<p>It also doesn't help that people make fun of me for seeming dumb.
Maybe its me being thick, but I can't honestly wrap my head around what the fundamental good thing in functional programming is. When ever I work in a functional language I just find myself missing objects.<p>OOP just feel more eloquent to look at personally.<p><pre><code> Struct.function(arg1, arg2, arg3);
</code></pre>
feels more atheistically pleasing to my mental model of programming then<p><pre><code> function(struct, arg1, arg2, arg3);
</code></pre>
This means more complex function definitions. While I can define multiple .close(); functions, that only operate in relation to their connection type I.E.: tcpConnection, serialConnection can each call their own close(). In FP I have to actually state either:<p><pre><code> fn close<T>(&:<T>){
if(<T>::isType(tcpConnection)){
tcpConnectionClose(<T>);
}else if(<T>::isType(serialConnection)){
serialConnectionClose(<T>);
}else{
//throw exception
}
}
</code></pre>
Or I just make primitive calls to each connection type<p><pre><code> tcpConnectionClose(*);
</code></pre>
This just doesn't stroke me the right way. It feels like bulky, over necessary coding when you take into account objects exist. I'm interested in FP, I feel it has to offer something for people to jump on it, but I just don't get it.
"Functional programming is the mustachioed hipster of programming paradigms."<p>Well, <i>that's</i> not helping. But I agree that devs should learn FP, and I now write in a much more functional style than I used to. I resisted for a long time, and that was a mistake.
> The literature relies on somewhat foreboding statements like “functions as first-class objects,” and “eliminating side effects.<p>I personally find this view a little overbearing.<p>In "lay programmer's" terms, functions as first-class objects can often come down to being able to pass functions to other functions or function composition. Most of us learned about function composition in Algebra 2... So that's pretty straightforward even at its worst.<p>Eliminating side effects is equally straightforward in that all it means is that any variables outside the scope of a given function are not changed by the function.
one of the points of the article is wrong, fp isn't stateless at all it just tends to represent state in a different way - look at monads in haskell.
If you're interested in learning FP but struggling and would like to beta test didactic material for beginners, I urge you to get in touch with me. I'm making a series of videos explaining the concepts and abstractions of functional programming in a socratic way and from scratch (so not assuming even that numbers exist). I'm 'uploaded' at google's email service.