r/coding • u/MaoStevemao • Mar 01 '20
Why is Learning Functional Programming So Damned Hard?
https://medium.com/@cscalfani/why-is-learning-functional-programming-so-damned-hard-bfd00202a7d14
u/Comrade_Comski Mar 02 '20
He informed me that he was planning to take away our ability to do what we were doing at the compiler level in the very next release.
Holy shit what a total dick move. This almost makes me want to drop elm
21
u/titanotheres Mar 02 '20 edited Mar 02 '20
It isn't.
Edit: or rather it doesn't have to be
-17
u/dAnjou Mar 02 '20
r/iamverysmart ...
15
Mar 02 '20
Not him but it's true. It seems hard but after you understand how it works it suddenly becomes simple, and you find yourself using functional programming concepts in every language.
-5
u/dAnjou Mar 02 '20
Well duh ... this is what learning is.
Also, it's very subjective. For some people it's easy maybe because they have a stronger background in mathematics, for others it's hard because they don't.
Simply saying "It isn't." is just plain stupid and suggests an elitist attitude.
5
u/DonaldPShimoda Mar 02 '20
Actually, some research has shown that functional programming is easier to learn than object-oriented programming... so long as it's the first paradigm you learn. And in fact, learning FP and then OOP is more straightforward than the other direction.
The speculation for why this is is that FP is all about writing stateless code that focuses on data transformations, whereas OOP code is often stateful and focuses on data manipulations. It's like learning calculus the long way first versus later. Integrating by taking the limit of an infinite number of infinitely thin boxes under a curve is a pain in the ass if you first learn all the shortcuts, but learning the boxes first makes for a much better experience.
I don't have a specific citation handy for you offhand since I'm on mobile, but I'm pretty sure the work was led by Shriram Krishnamurthi at Brown. His research focuses on the intersection of functional programming and education.
1
1
1
u/bythenumbers10 Mar 02 '20
Did NOBODY notice the part where the creator of a programming language got mad that people wanted to use that language in all kinds of places beyond the creator's original intent? Is that not the point of creating and providing a programming language? More importantly, what size asshat does the creator of Elm wear?
2
0
Mar 02 '20
[deleted]
-8
Mar 02 '20
I can get a bachelors degree in four years mate and you’re just starting to find it a breeze just now?
3
u/rubydoobiez Mar 02 '20
Tell me about it, I wanted ram my face through my computer screen tonight trying to get it wrapped around JavaScript recursion ðŸ˜