Based on Companion repo for Functional Programming for Beginners with Javascript and refactored to Typescript
Original forked repo github.com/seyfer/fpjs
"Why should I learn Functional Programming?"
Most software written today, is overly complex, difficult to understand, challenging to test, hard to change and filled with hard find bugs.
Ouch! So how do we end up with these problems?
Here’s a few of the many reasons:
These are just a few of the many problems that lead to frustrating jobs, working on codebases that are hard to maintain and add features to.
Functional programming addresses the above problems in the following ways:
Functional programming, in my experience, is more productive than Object Oriented Programming because there are fewer things to think about, so you don’t overwhelm your working memory. Usually your just thinking about plain old data, and data transformations, using functions. Additionally, in Functional Programming, there aren’t tons of competing ways of doing the same thing, so you don’t have to think about unnecessary things. Functional Programming is constraining, and thats a good thing. You’re able to better focus, on the problem you’re solving, rather than the tools you’re using to solve the problem.
In Object Oriented Programming, you have to think about many different types of complicated, stateful objects that can be interacted with in different ways. You’ve got to think about more than just data, and data transformation… You’ve got to think about things like State and Side Effects, far more than you do in Functional Programming.