Functional Programming - the True Silver Bullet.

Many programming paradigms have come and gone. Is Functional Programming here to stay? Or is it just another fad?

What is a silver bullet?


Determinism vs Nondeterminism

(Or Predictability vs Unpredictability)

Photo by Annie Spratt on Unsplash

Let’s recap

Is functional programming deterministic?

Avoid mutable state

Photo by Andrew Neel on Unsplash

The need for discipline

Embrace immutable state

Photo by Pablo Heimplatz on Unsplash

Nothing changed, nothing shared. Ever.

Example with immutable state

Before: [3, 5, 4, 1, 2, 9]
After: [1, 2, 3, 4, 5, 9]

Nothing new

Advantages of immutable state

Disadvantages of immutable state

Persistent data structures

Illustration by Vineet Kumar on Wikimedia Commons


Photo by Christian Wiediger on Unsplash

Avoiding nulls — the billion dollar mistake

Photo by Bernard Hermant on Unsplash

Error handling

Photo by Michael Geiger on Unsplash

Programming with pure functions

Photo by yann bervas on Unsplash

Algebraic data types

Photo by Josh Riemer on Unsplash

Pattern matching

Photo by Ryoji Iwata on Unsplash

Is Functional Programming a silver bullet?

What’s next?

Senior full-stack engineer. Elixir/ReasonML/React.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store