Where to start
If you are reading this, you are probably in the same position as most developers, you already know the definition of functional programming, you’re keen to learn more, but don’t know where to start.
Over the last couple of months I’ve been trying courses and searching for beginner friendly content that will help you on that journey. Here is what I can recommend to get you started.
Learn the fundamentals of functional programming — for free, in your inbox - an excellent intro to fp from Preethi Kasireddy
repl to try out new functions and function composition for yourself. This is the most important step of all.
There are many other resources that I could have listed here, but it is easy to get overwhelmed and give up before you get started. The most important thing here is to have fun and practice what you have learnt, as much as possible.
Tackle some challenges
Congratulations if you have made it this far, even though fp is great fun, it takes a fair bit of persistence, well done!
Time to test your hard gained knowledge!
Take a look at JS libraries like Ramda or lodashFP. They offer most of the functionality you are looking for, without having to write your own library.
If this is all too easy for you, check out Sanctuary JS
Although JS can be considered a Functional Programming language, it is not a pure functional programming language. Many of the more advanced patterns can become quite contrived and are so difficult to implement, they probably aren’t worth attempting. Time to try something new.
An excellent place to start is Elm. I can’t offer enough praise for their amazing compiler or the super friendly community. Sure there is plenty of competition popping up in the frontend FP arena, but none are quite as beginner friendly(at present).
This is where I run out of experience. My personal journey has taken me down the path of starting to learn Haskell. It is an amazing language. For example this is a way to create a list of even numbers in the range 1 to 10, that aren’t 6: [ x | x <- [1…10], x
mod 2 == 0, x/=6 ]. Try that for yourself in JS and let me know if you manage it in one line. If that has peaked your interest, check out these resources:
If you haven’t already joined, come join us at Barely Functional Exercism and test your new Elm, Haskell or JS skills and help out your fellow learners, by leaving code reviews.