HACKER Q&A
📣 mraza007

Why Learn Functional Programming


What are some reasons to learn functional programming. I have tried learning it but it gets complicated understand few concepts.


  👤 lalo2302 Accepted Answer ✓
Why I think FP is getting popular:

* It's old as hell which means is battle proven * Before it was hard to understand since everything pointed to look at it with a "mathematical view" which not every developer has. Now there are more tutorials and "Blog posts" * New technologies emerged which follow the pattern with familiar syntax and great tooling.

Right now why should you? I'd say why not? If you already know OOP, FP can give you more ways on think about problems and solutions. Plus, it can give you a competitive advantage over other developers.

It is definitely not a hammer which can nail down everything, but it's a good tool to have around.


👤 CLPadvocate
actually, this IS the point of learning FP. it's a different way of thinking about programming and it offers you a new way (often a more elegant) of doing things.

it's usually worth the effort. writing code in a functional way (even without a functional programming language) simplifies testing, often improves program stability and robustness. the more side-effect-free or pure blocks you have in your code, the easier you can build a composable or a concurrent program. basically, most of the principles of good software development (SOLID, DRY, KISS, ...) are native to FP.


👤 bensherman228
functional programming is a catch-all term for a way of writing code that is focused on composing pure functions, actually using the innovations in type systems made in the last few decades, and overall being awesome. This one also gives such advantages: the ability to manage complexity with abstractions, more safe, reliable, composable code, better maintainability I would advise you to read this article - https://serokell.io/blog/introduction-to-functional-programm..., this article also has links to other useful topics that relate to this topic.