
Ask HN: What's your biggest challenge in trying to learn functional programming? - cmscalzo
I&#x27;m interested in what others are doing to learn FP:<p>- what&#x27;s been your biggest challenge so far?
- what has worked and what hasn&#x27;t?
- why did you decide to learn FP?<p>Thanks!
======
ljoshua
I’ll bite. I haven’t done huge dives into it, but I’ve definitely gone through
the Learn F# interactive tutorial and spent some time working through some
Scala lessons a while ago. I would love to be doing more FP work just because
of the testimonials of others in how it has improved their craft.

The most difficult thing thus far has been that I haven’t seen where many of
the more interesting FP concepts fit into my daily programming efforts. I am
most frequently working on LOB applications, mobile apps, or backend APIs.
It’s very much the world of take a model, do something to it, and return it. I
know that it comes with practice, but often times the cool chaining and
currying concepts, FP modifiers (except for map and a couple other simple
functions) just don’t seem to apply when I think about the problems I’m trying
to solve. The tutorials often lack any real-world examples, focusing more on
math problems or “not real data” uses.

That being said, one of the biggest things that I _have_ taken away is the
idea that, given the same inputs a function should always return the same
outputs, and be free of outside state. That has definitely helped me improve
my coding.

~~~
ljoshua
Or to put a more fine point on it, if I’m writing SaaS-style web applications,
which as most do are CRUD implementations, where do FP languages and concepts
help me out? That’s the question I haven’t seen addressed well in the beginner
materials, despite the presence of langs and frameworks like Elixir, Phoenix,
Clojure(script), F#, etc.

------
raquo
What hasn't worked: thinking in terms of monads / applicatives / functors /
other FP / category theory concepts.

I know what those are, but this is just not how I see the world, and forcing
myself to think about code in those terms just isn't productive.

What worked: using FP composition / organization / abstraction patterns that
often involve those same FP concepts but without cargo culting.

Non-hardcore FP has been very rewarding to me. With Scala, mixing FP and OOP
patterns is a great way to get the best of both worlds.

