FP adoption at REA A human-first approach @KenScambler 11 Major - - PowerPoint PPT Presentation

fp adoption at rea
SMART_READER_LITE
LIVE PREVIEW

FP adoption at REA A human-first approach @KenScambler 11 Major - - PowerPoint PPT Presentation

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 Teams using


slide-1
SLIDE 1

FP adoption at REA

A human-first approach

@KenScambler

slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

11

slide-6
SLIDE 6

Major companies using FP

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9

FP journey

slide-10
SLIDE 10
slide-11
SLIDE 11
  • ~150 developers in Melbourne
  • ~100 TW consultants in China
  • ~90 in Malaysia
  • Handful in Singapore, Thailand,

Indonesia

slide-12
SLIDE 12

2013 2014 2015 2016 2017

Teams using Scala

slide-13
SLIDE 13

2013 2014 2015 2016 2017

Scala codebases

100 50 1 7 17 38 91

Total codebases: ~5200 ~2% are Scala

slide-14
SLIDE 14

Beyond Scala

Of 858 public channels:

  • #28 all-time messages
  • #28 total members
  • #32 users posting messages
slide-15
SLIDE 15

Weekly FP Guild session

2013 2014 2015 2016 2017 50 10 15 18 25 Attendance/week 10 20 30 40 4 15 14 17 … Different presenters

slide-16
SLIDE 16

YOW Lambda Jam 2017 C◦mp◦se :: Melbourne 2017

slide-17
SLIDE 17
slide-18
SLIDE 18

Human approach

slide-19
SLIDE 19

SOFTWARE COMPANY

  • Solve my problems
  • Help me do what I

do

  • On time
  • Supported

Customers

Real world Software

slide-20
SLIDE 20

Customers Users

SOFTWARE COMPANY

  • Easy to use
  • Make my

life easier

  • Reliable
slide-21
SLIDE 21

Customers Users Management

  • Bottom line
  • Hiring?
  • Long term view
  • Org health
  • Manage risk
slide-22
SLIDE 22

Customers Users Product Managers

  • Verify assumptions
  • Features!
  • Time to market

Management

slide-23
SLIDE 23

Customers Users Product Managers Management

  • Sleep at night
  • Visibility
  • Uptime, security,

latency, performance, etc Site Ops

slide-24
SLIDE 24

Customers Users Product Managers Management

  • Determinism
  • Reproducibility
  • Confidence

Site Ops QAs

slide-25
SLIDE 25

Customers Users Product Managers Management

  • Do great work
  • Solve problems
  • Feel productive
  • Learn!

Site Ops QAs Developers

YOW

slide-26
SLIDE 26

Customers Users Product Managers Management Site Ops QAs

THE CODE

Developers

YOW

slide-27
SLIDE 27

Tech is ok, but nothing makes sense unless it makes people’s lives better

YOW

slide-28
SLIDE 28

The easy bit

YOW

THE HARD BIT

slide-29
SLIDE 29

YOW

Why bother?

slide-30
SLIDE 30
  • Input  Output
  • Less moving parts
  • Less coupling
  • Fewer possible incorrect

programs

  • Better separation of

concerns

THE CODE

slide-31
SLIDE 31

THE CODE

  • Can actually know things

about the code

  • Refactoring is easier!
  • Great code reuse
  • I’m learning!

Developers

YOW

slide-32
SLIDE 32

THE CODE

Developers

YOW

QAs

  • Same input gives

same response!

  • We can reproduce

things

slide-33
SLIDE 33

THE CODE

Developers

YOW

QAs

  • Rarely fails, in well

understood ways

  • I can sleep

Site Ops

slide-34
SLIDE 34

THE CODE

Developers

YOW

QAs

  • Devs could

painlessly bolt my features on that old codebase!

  • I don’t hear “no” as
  • ften

Site Ops Product Managers

slide-35
SLIDE 35

THE CODE

Developers

YOW

QAs Site Ops Product Managers Management

  • Great for hiring!
  • Vibrant, energetic

team

  • Microservices mitigate

risk in tech choice

slide-36
SLIDE 36

THE CODE

Developers

YOW

QAs Site Ops Product Managers Management Customers / Users

  • Reliable!
  • Regular

updates

slide-37
SLIDE 37

Tech choices are important because they can make people’s lives better

YOW

slide-38
SLIDE 38

YOW

slide-39
SLIDE 39

YOW

slide-40
SLIDE 40

Alan Turing Turing machines Alonzo Church The Lambda Calculus

Programming languages existed before computers did

slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43

Programs exist like numbers exist!

slide-44
SLIDE 44

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

  • f human error

Long-term consequence Happiness, productivity & wisdom Quit and become a dentist like Mum always wanted

slide-45
SLIDE 45
slide-46
SLIDE 46

...It would be a mistake to characterize lambda calculus as a universal language, because calling it universal is too limiting.

Phil Wadler

slide-47
SLIDE 47

@

FP Guild, team dojos Chat channels Shared norms Central expert group

#

slide-48
SLIDE 48

shared norms iOS shared norms shared norms shared norms Weekly guild meetings #functionalprogramming

slide-49
SLIDE 49

Weekly guild meetings #functionalprogramming #sig-scala shared norms shared norms shared norms

slide-50
SLIDE 50

advice code review articles support secondment training sessions shared norms shared norms shared norms

Central expert group

slide-51
SLIDE 51

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!

slide-52
SLIDE 52

Maybe

We’ve got a couple of Scala devs, and the rest

  • f 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...

slide-53
SLIDE 53

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

slide-54
SLIDE 54

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”

slide-55
SLIDE 55

Case study 1: Colliding teams

Chalk Services Cheese Experience

slide-56
SLIDE 56

Time for a re-org! You are now the “Chalk & Cheese Dept”

slide-57
SLIDE 57

Hi there! Welcome! Hooray! Let’s get to work.

slide-58
SLIDE 58

The hell am I even looking at

slide-59
SLIDE 59

Seriously, I’ve been doing this for 10 years and now I can’t do anything

slide-60
SLIDE 60

Oops! Let’s scale it back a notch.

slide-61
SLIDE 61

Cheers! No worries! You’re doing great.

slide-62
SLIDE 62

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.

slide-63
SLIDE 63

We have to help our teammates! I’ll make tutorials… I’ll run a weekly training session!

slide-64
SLIDE 64

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?

slide-65
SLIDE 65

Case study 2: Decay & drift

Time for something new! Let’s use Scala

slide-66
SLIDE 66

Can you help us with some weekly training sessions? Sure!

slide-67
SLIDE 67
slide-68
SLIDE 68

6 months later… turnover!

slide-69
SLIDE 69

What do we do with this thing?

slide-70
SLIDE 70

I never really wanted this tbh Me neither

slide-71
SLIDE 71

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!

slide-72
SLIDE 72

Sure, I can fit you in

  • nce/week!

Could you help us with some training?

slide-73
SLIDE 73

It’s up to me to make sure my teammates are having a good time with this

slide-74
SLIDE 74

Let’s keep it simple… Good idea!

slide-75
SLIDE 75

val modifyBanana(b: Banana): Banana = ???

slide-76
SLIDE 76

val modifyBanana(b: Banana): Banana = ???

Oh man. Struggling. Let’s slow down! I’ll help out.

slide-77
SLIDE 77

Weekly survey How are you finding it? 1 5 etc 1 5 Can you use technique X in anger?

Let’s keep track of

  • ut progress, to

work out how we’re doing!

slide-78
SLIDE 78

val modifyBanana(b: Banana): Banana = ???

Still struggling. You’re doing great! We’ll all help

slide-79
SLIDE 79

6 months later… success!

Project was a success! Well done team! We’re really happy with this code! We’ve levelled up!

slide-80
SLIDE 80

Antipatterns

How FP adoptions fail

slide-81
SLIDE 81

Antipattern 1: Under the rug

I’m going to lose my hipster badge at this rate

slide-82
SLIDE 82
slide-83
SLIDE 83
slide-84
SLIDE 84

Haskell in prod, LIVING THE DREAM BABY!!!

slide-85
SLIDE 85
slide-86
SLIDE 86
slide-87
SLIDE 87
slide-88
SLIDE 88

Where did this come from?? I never would have agreed to this! It looks weird and we didn’t sign up for this

slide-89
SLIDE 89

Antipattern 2: Wizard Tower

slide-90
SLIDE 90

Profunctor optics! Church-encoded free

  • monad. Left Kan

extension enriches

  • ur algebra into a

functor…..etc Why on earth would we care about all that?

Tense, fragile situation…

slide-91
SLIDE 91

Soon enough… Howdy folks I’m the new CTO! I’m really excited to….GOOD LORD what is going on there

slide-92
SLIDE 92
slide-93
SLIDE 93
slide-94
SLIDE 94

You hear something? Nope.

slide-95
SLIDE 95

Antipattern 3: Flock of seagulls

Can you folk help us out? AgileConsultyCorp Sure can!

slide-96
SLIDE 96

This will never do! Let’s add some AgileConsultyCorp pizzazz!

slide-97
SLIDE 97
slide-98
SLIDE 98
slide-99
SLIDE 99
slide-100
SLIDE 100

FP Guild

Every Wednesday 4pm without fail

f ◦ (g ◦ h) = (f ◦ g) ◦ h

slide-101
SLIDE 101

2014

f ◦ (g ◦ h) = (f ◦ g) ◦ h

4x

slide-102
SLIDE 102

2015

(theory)

f ◦ (g ◦ h) = (f ◦ g) ◦ h

15x

(12x first time speakers)

slide-103
SLIDE 103

2016

(theory)

f ◦ (g ◦ h) = (f ◦ g) ◦ h

14x

(6x first time speakers)

slide-104
SLIDE 104

2017

f ◦ (g ◦ h) = (f ◦ g) ◦ h

(theory) 17x

(7x first time speakers)

slide-105
SLIDE 105

Low bar

  • Timebox to 2 hours prep, max
  • Lower bar means more speakers
  • More diverse speakers
  • Sanity for organisers
slide-106
SLIDE 106

Consistency

“The show doesn’t go on because it’s ready; it goes on because it’s 11:30.”

  • Lorne Michaels, SNL creator
slide-107
SLIDE 107

Consistency

  • Consistency is really important for building

confidence in a group

  • Every Wednesday 4pm without fail, 4 years

running

  • (except for Christmas & Hackathons)
slide-108
SLIDE 108

Consistency

  • 1. Call for talks on Monday
  • 2. Pester individuals
  • 3. Riff on something off the top of head
  • 4. Watch video

Fallbacks:

slide-109
SLIDE 109

Variety

Same thing…

slide-110
SLIDE 110

Variety

Same thing…

slide-111
SLIDE 111

Variety

Same thing…

slide-112
SLIDE 112

Variety

Same thing…

Week-to-week variety in speakers & topics is important!

slide-113
SLIDE 113

Look after beginners and the experts will look after themselves

slide-114
SLIDE 114

Blah blah monad stack, typeclass coherence I’ll bet I’m the only person who doesn’t understand this

Imagined:

slide-115
SLIDE 115

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

slide-116
SLIDE 116
  • Natural bias toward advanced talks
  • Encourage beginner talks
  • Encourage beginners talking!
  • Bigger, more diverse crowds
slide-117
SLIDE 117
  • 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