Intro
Why Functional Programming?
Why answer the question at all?
Coding isn’t done in a bubble. It’s done in teams. So if you want to implement functional programming in your team’s code, you’ll need to convince your teammates of its value.
Imperative vs. declarative
The first thing often said about the value of functional programming boils down to the distinction between imperative and declarative.
Imperative programming is where your code says how something is to be done. You know some code is imperative if a reader has to mentally execute the code in their minds, pretending to think like a computer.
However, this is error prone, as humans aren’t great at thinking like computers. As a result, imperative code is harder to understand, making it harder to maintain, to fix, and to improve.
Declarative programming, in contrast, is focused more on the what or the outcome. It’s code that, to the best extent possible, doesn’t require code commenting because the intention and outcome is clear.
Confidence and surface area
Functional programming principles are grounded on sound mathematical reasoning. Just like we know 1 + 1 = 2 without needing proof, we can trust functional programming patterns/principles because they have been mathematically proven by very smart people.
Functional programming, therefore, gives you confidence in your code—an alternative to testing!
As a result of this confidence, you don't have to worry about a good chunk of your code. More attention can go to your business logic. You are reducing the surface area of what you have to maintain and debug.
Course Overview
This course takes a bottom-up approach, focusing on the fundamental building blocks to get you started on your functional programming journey. (Contrast this with a top-down approach, which focuses on high-level theory first, making the content more inaccessible.)
The topics will be:
Functions: what they are and how they work
Closure: arguably a foundation to do anything else in functional programming
Composition
Immutability
Lists/Data Structures: things like map, filter, reduce
Async
Helper Libraries: libraries that help make functional programming quicker
Last updated