FP adoption at REA
A human-first approach
@KenScambler
11
Major companies using FP
FP journey
• ~150 developers in Melbourne
• ~100 TW consultants in China
• ~90 in Malaysia
• Handful in Singapore, Thailand,
Indonesia
2013 2014 2015 2016 2017
Teams using Scala
2013 2014 2015 2016 2017
Scala codebases
100
0
50
1
7
17
38
91
Total codebases: ~5200
~2% are Scala
Beyond Scala
Of 858 public channels:
• #28 all-time messages
• #28 total members
• #32 users posting messages
Weekly FP Guild session
2013 2014 2015 2016 2017
0
50
10
15
18
25
Attendance/week
10
20
30
40
4
15 14
17
…
Different presenters
YOW Lambda Jam 2017
C◦mp◦se :: Melbourne 2017
Human approach
SOFTWARE COMPANY
• Solve my problems
• Help me do what I
do
• On time
• Supported
Customers
Real world Software
Customers
Users
SOFTWARE COMPANY
• Easy to use
• Make my
life easier
• Reliable
Customers
Users
Management
• Bottom line
• Hiring?
• Long term view
• Org health
• Manage risk
Customers
Users
Product Managers
• Verify assumptions
• Features!
• Time to market
Management
Customers
Users
Product Managers
Management
• Sleep at night
• Visibility
• Uptime, security,
latency, performance,
etc
Site Ops
Customers
Users
Product Managers
Management
• Determinism
• Reproducibility
• Confidence
Site Ops
QAs
Customers
Users
Product Managers
Management
• Do great work
• Solve problems
• Feel productive
• Learn!Site Ops
QAs
Developers
YOW
Customers
Users
Product Managers
Management
Site Ops
QAs
THE CODEDevelopers
YOW
Tech is ok, but nothing makes sense
unless it makes people’s lives better
YOW
The easy bit
YOW
THE
HARD
BIT
YOW
Why bother?
• Input  Output
• Less moving parts
• Less coupling
• Fewer possible incorrect
programs
• Better separation of
concerns
THE CODE
THE CODE
• Can actually know things
about the code
• Refactoring is easier!
• Great code reuse
• I’m learning!
Developers
YOW
THE CODEDevelopers
YOW
QAs
• Same input gives
same response!
• We can reproduce
things
THE CODEDevelopers
YOW
QAs
• Rarely fails, in well
understood ways
• I can sleep
Site Ops
THE CODEDevelopers
YOW
QAs
• Devs could
painlessly bolt my
features on that old
codebase!
• I don’t hear “no” as
often
Site Ops
Product Managers
THE CODEDevelopers
YOW
QAs
Site Ops
Product Managers
Management
• Great for hiring!
• Vibrant, energetic
team
• Microservices mitigate
risk in tech choice
THE CODEDevelopers
YOW
QAs
Site Ops
Product Managers
Management
Customers / Users
• Reliable!
• Regular
updates
Tech choices are important because
they can make people’s lives better
YOW
YOW
YOW
Alan Turing
Turing machines
Alonzo Church
The Lambda Calculus
Programming languages existed before computers did
Programs exist
like numbers
exist!
Fundamental
software principles
Applicability
VS
Last week’s hot
web framework
Every single day
Every language
Every problem
Every context
Next 6 months, if you’re
lucky
Substance Eternal and unchanging
fabric of the universe
Eternal hamster wheel of
memorising steaming piles
of human error
Long-term
consequence
Happiness, productivity &
wisdom
Quit and become a dentist
like Mum always wanted
...It would be a mistake to
characterize lambda calculus
as a universal language,
because calling it universal is
too limiting.
Phil Wadler
@
FP Guild, team dojos Chat channels
Shared norms Central expert group
#
shared norms
iOS
shared norms
shared norms
shared norms
Weekly guild
meetings
#functionalprogramming
Weekly guild
meetings
#functionalprogramming
#sig-scala
shared norms
shared norms
shared norms
advice
code review
articles
support
secondmenttraining sessions
shared norms
shared norms
shared norms
Central expert
group
Should my team use Scala?
Hey do you mind
helping out with some
advice for my team?
We’re thinking about
using Scala for the new
service…
Sure!
Maybe
We’ve got a couple of
Scala devs, and the rest
of the team is keen.
We want more
maintainable assets.
I can pay for an up-front
learning curve.
Maybe. Here’s
some options,
tradeoffs etc...
We have tight deadlines, a
new team of junior Ruby
programmers, multiple
stakeholders, and half our
team is in Xi’an.
I heard Scala will make us
more productive.
How can I make them like it?
ABSOLUTELY NOT
Good signs Bad signs
• Stable, established team
• Existing FP/Scala experience
• Project can bear learning curve
• Good sentiment
• Local developers
• Realistic expectations
• Unstable team
• Nobody knows Scala/FP
• Very tight deadlines
• Mixed or negative sentiment
• Offshore developers
• “It’s the cool new thing”
• “We’ll be immediately more
productive”
Case study 1: Colliding teams
Chalk Services Cheese Experience
Time for a re-org!
You are now the
“Chalk & Cheese Dept”
Hi there!
Welcome!
Hooray! Let’s
get to work.
The hell am I
even looking at
Seriously, I’ve been
doing this for 10
years and now I
can’t do anything
Oops! Let’s scale it
back a notch.
Cheers!
No worries! You’re
doing great.
6 months later…
Oof. This is all
going a bit
slower than we
thought…
Not going to
lie, this
Scala/FP stuff
is tough
Is this really the right
approach for us?
Hmmm.
We have to
help our
teammates! I’ll
make
tutorials…
I’ll run a weekly
training
session!
6 months later… Success!
Woohoo!
Productivity!
This
software is
rock solid!
Love it!
Devs are knocking
down the door to join.
Great results.
Future though?
Case study 2: Decay & drift
Time for
something new!
Let’s use Scala
Can you help us
with some weekly
training sessions?
Sure!
6 months later… turnover!
What do we do
with this thing?
I never really
wanted this tbh
Me neither
Case study 3: Empathy FTW
?
We do a lot of
maintenance, quality
matters.
A lot of our stuff is
already Scala.
We really want to learn.
I’m happy to
invest in our
skills!
Sure, I can fit
you in
once/week!
Could you help us
with some training?
It’s up to me to
make sure my
teammates are
having a good
time with this
Let’s keep it
simple…
Good idea!
val modifyBanana(b:
Banana): Banana = ???
val modifyBanana(b:
Banana): Banana = ???Oh man.
Struggling.
Let’s slow down!
I’ll help out.
Weekly survey
How are you
finding it?
1 5
etc
1 5
Can you use
technique X in anger?
Let’s keep track of
out progress, to
work out how
we’re doing!
val modifyBanana(b:
Banana): Banana = ???
Still struggling.
You’re doing
great! We’ll all
help
6 months later… success!
Project was a
success! Well
done team!
We’re really
happy with this
code!
We’ve
levelled
up!
Antipatterns
How FP adoptions fail
Antipattern 1: Under the rug
I’m going to
lose my
hipster badge
at this rate
Haskell in prod,
LIVING THE
DREAM BABY!!!
Where did this come
from??
I never would have
agreed to this!
It looks weird and we
didn’t sign up for this
Antipattern 2: Wizard Tower
Profunctor optics!
Church-encoded free
monad. Left Kan
extension enriches
our algebra into a
functor…..etc
Why on earth
would we care
about all that?
Tense, fragile situation…
Soon enough… Howdy folks I’m the
new CTO!
I’m really excited
to….GOOD LORD what
is going on there
You hear
something? Nope.
Antipattern 3: Flock of seagulls
Can you folk
help us out? AgileConsultyCorp
Sure can!
This will
never do!
Let’s add some
AgileConsultyCorp
pizzazz!
FP Guild
Every Wednesday 4pm without fail
f ◦ (g ◦ h) =
(f ◦ g) ◦ h
2014
f ◦ (g ◦ h) =
(f ◦ g) ◦ h
4x
2015
(theory)
f ◦ (g ◦ h) =
(f ◦ g) ◦ h
15x
(12x first time speakers)
2016
(theory)f ◦ (g ◦ h) =
(f ◦ g) ◦ h
14x
(6x first time speakers)
2017
f ◦ (g ◦ h) =
(f ◦ g) ◦ h
(theory)17x
(7x first time speakers)
Low bar
• Timebox to 2 hours prep, max
• Lower bar means more speakers
• More diverse speakers
• Sanity for organisers
Consistency
“The show doesn’t go on because it’s
ready; it goes on because it’s 11:30.”
- Lorne Michaels, SNL creator
Consistency
• Consistency is really important for building
confidence in a group
• Every Wednesday 4pm without fail, 4 years
running
• (except for Christmas & Hackathons)
Consistency
1. Call for talks on Monday
2. Pester individuals
3. Riff on something off the top of head
4. Watch video
Fallbacks:
Variety
Same thing…
Variety
Same thing…
Variety
Same thing…
Variety
Same thing…
Week-to-week variety in speakers & topics is important!
Look after beginners and the experts will look
after themselves
Blah blah monad stack,
typeclass coherence
I’ll bet I’m the only
person who
doesn’t understand
this
Imagined:
Blah blah monad stack,
typeclass coherence
I’ll bet I’m the only
person who
doesn’t understand
this
Actual: I’ll bet I’m the only
person who
doesn’t understand
this
I’ll bet I’m the only
person who
doesn’t understand
this
I’ll bet I’m the only
person who
doesn’t understand
this
I’ll bet I’m the only
person who
doesn’t understand
this
• Natural bias toward advanced talks
• Encourage beginner talks
• Encourage beginners talking!
• Bigger, more diverse crowds
• Functional programming is totally awesome
• Technical benefits are worth pursuing
• None of it matters a damn unless you can make it help people
• By taking a human-first approach, a sustainable, self-perpetuating
culture of learning and achievement is possible, to everyone’s
benefit
Conclusion

FP adoption at REA