- 0 0
One thing I'm discovering is that transforming data is easier to think about than maintaining state. - Dave Thomas
A few months back, in the wake of wrapping my head around observables and RxJS (still a work in progress), I spent a bunch of time digging through resources on functional programming. I left this compilation sitting in my drafts folder for a while, but then last night I stumbled upon this excellent article by Wayne Maurer on reactive data flow in Angular 2. Maurer expounds on André Staltz's concept of Model-View-Intent (MVI) in a reactive framework. It seems to me that one needs to grasp concepts of functional programming in order to fully understand reactive programming, so, to that end, here are some resources I've found helpful.
Functional Programming Basics and Overview
These videos and articles focus on broad FP concepts without delving too much into syntax or language-specific implementations.
- Functional Programming should be your #1 priority for 2015 by Ju Gonçalves
- Introduction to Functional Programming by Kelley Robinson, a 10 minute intro to basic FP concepts.
- Learning Functional Programming Without Growing a Neckbeard by Kelsey Innis, really well done presentation using Scala for examples.
- Functional Thinking by Neal Ford in 2012, a bit more advanced and uses Java and Groovy for examples.
Functional Languages: Haskell & Elm
Haskell has been around for a long time, but has been swinging back into popularity recently.
- Learn You a Haskell for Great Good! by Miran Lipovaca, a classic
- Haskell Fundamentals Part 1 by Benson Joeris, via Pluralsight (there's also a Part 2)
- JSJ: Elm with Evan Czaplicki and Richard Feldman, an excellent overview of the language
- Elm: Getting Started
- Climbing Into Elm by Murphy Randle
- My Adventure with Elm by Yan Cui, which references:
- Controlling Time and Space: understanding the many formulations of FRP by Evan Czaplicki and
- Inventing on Principle by Bret Victor
In the end, my takeaways can be summed up by a few notes I took during Neal Ford's talk. Functional programming stresses:
- Immutability over state transactions
- Results over steps
- Composition over structure
- Declarative over imperative
And, of course, composition over structure is all the rage these days in the JS world, and Angular 2 is no exception.
I'll leave you with this tweet from Michael Feathers:
OO makes code understandable by encapsulating moving parts. FP makes code understandable by minimizing moving parts.
Happy (side-effect-free) coding!