r/functionalprogramming • u/Neither-Acadia2395 • Nov 05 '23
Question Why is functional programming so hard
Throughout my entire degree till now, I’ve been taking OOP. Now I am in a FP course and I am struggling a lot. I understand it’s almost a total different thing. But I just failed a midterm in FP in Ocaml. I swear I could’ve solved the questions with my eyes closed in OOP. What am I doing wrong, why can’t I get a grasp of it. Any tips on how I should approach studying this.
78
Upvotes
View all comments
Show parent comment
4
u/jecxjo Nov 07 '23
The benefit you get is you cant cheat. It becomes too easy to switch from FP in other languages when you can't solve a problem. If you're at work that's not a horrible thing but it means you may not be getting the best bang for your buck. But when you're learning you should force yourself to be FP only when using a language.
I've used Haskell for internal tools. Wrote a few parsers for internal programming languages for products we built, wrote converters to take data sources to generate source code (csv to C# libraries) and I've used Servant to make a RESTful API