By Paul Burt!
In this presentation, I argue that Functional Programming is great for infrastructure. But, the Worker pattern is more familiar to OO folks, while offering many of the same advantages.
SLIDE NOTES:
2)
I’m a Developer Evangelist at iron.io.
We make easy to use, high throughput, infrastructure solutions.
4)
Functional Programming and Reactive Infrastructure are trendy.
For good reason, they require fewer mental gymnastics than traditional approaches.
7)
https://medium.com/javascript-scene/the-two-pillars-of-javascript-pt-2-functional-programming-a63aa53a41a4
8)
http://www.reactivemanifesto.org/
9)
Image CC BY 2.0
tracy the astonishing https://www.flickr.com/photos/tracy_the_astonishing/3398886840
12)
Image CC BY 2.0 https://upload.wikimedia.org/wikipedia/commons/e/e0/The_Grumpy_Old_Punks.jpg
14)
Quote from https://en.wikipedia.org/wiki/Idempotence#Examples
15)
The response is returning a webpage. This may change between requests. The “outcome” is the resource returns a page.
17)
Fish is treats other fish just like any other piece of food.
Functions should be treated just like any other variable.
CC BY 2.0 source https://www.flickr.com/photos/38446022@N00/2874171158
18)
One thing to note, this code is odd to write. But, it’s easy to read Hungry(bear). It gets even easier with piping syntax.
20)
One function does work.
The output is passed to the next one.
CC BY 2.0 from Alden Jewell https://www.flickr.com/photos/autohistorian/16617915558
22)
Image CC BY 2.0 https://upload.wikimedia.org/wikipedia/commons/4/4a/Todd_Huffman_-_Lattice_(by).jpg
25)
Like this banana slicer that does one thing, and does it well...
26)
Write code purpose built for one task. Chain tasks together. Yay composability!
28)
CC BY 2.0 Beate Meier https://www.flickr.com/photos/beate_meier/8337014543
31)
CC BY 2.0 khrawlings https://www.flickr.com/photos/khrawlings/3622143862/
32)
http://bravenewgeek.com/you-cannot-have-exactly-once-delivery/
33) This Greek structure was shoddily repurposed, just like many try to repurpose yesterday's infrastructure.
Image CC BY 2.0 https://upload.wikimedia.org/wikipedia/commons/1/11/Vilnius_Cathedral_Facade.jpg
34)
Image from http://www.reactivemanifesto.org/
39)
FP offers a declarative approach.
This simplifies reading, reasoning, and debugging code.
Writing is harder, which makes it hard to get a big team to adopt.
41)
They’re fast,
fail gracefully, message driven,
and are easy to scale
42)
Devs already embrace OOP.
Just need to make code more modular. Embrace the Unix philosophy.
Workers are a natural way to get many benefits of FP, without the learning curve.