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 Scala 2013 2014 2015 2016 2017
Scala codebases 91 100 Total codebases : ~5200 ~2% are Scala 50 38 17 7 1 0 2013 2014 2015 2016 2017
Beyond Scala Of 858 public channels: • #28 all-time messages • #28 total members • #32 users posting messages
Weekly FP Guild session 50 40 25 30 Attendance/week 18 … 15 20 Different presenters 17 10 14 15 10 4 0 2013 2014 2015 2016 2017
YOW Lambda Jam 2017 C ◦ mp ◦ se :: Melbourne 2017
Human approach
• Solve my problems • Help me do what I do • On time • Supported Customers SOFTWARE COMPANY Real world Software
Customers SOFTWARE COMPANY • Easy to use • Make my life easier • Reliable Users
• Bottom line Customers • Hiring? • Long term view • Org health • Manage risk Management Users
• Verify assumptions • Features! Customers • Time to market Management Product Managers Users
• Sleep at night • Visibility • Uptime, security, latency, performance, Customers etc Site Ops Management Product Managers Users
Customers Site Ops • Determinism • Reproducibility Management • Confidence Product Managers QAs Users
• Do great work Customers • Solve problems • Feel productive • Learn! Site Ops YOW Management Product Managers Developers QAs Users
Customers Site Ops YOW Management THE CODE Product Managers Developers QAs Users
YOW Tech is ok, but nothing makes sense unless it makes people’s lives better
THE HARD YOW BIT The easy bit
Why bother? YOW
• Input Output • Less moving parts • Less coupling • Fewer possible incorrect programs • Better separation of concerns THE CODE
• Can actually know things about the code • Refactoring is easier! • Great code reuse • I’m learning! YOW THE CODE Developers
• Same input gives same response! • We can reproduce things YOW THE CODE Developers QAs
• Rarely fails, in well understood ways • I can sleep Site Ops YOW THE CODE Developers QAs
• Devs could painlessly bolt my features on that old codebase! • I don’t hear “no” as often Site Ops YOW THE CODE Product Managers Developers QAs
• Great for hiring! • Vibrant, energetic team • Microservices mitigate risk in tech choice Site Ops YOW Management THE CODE Product Managers Developers QAs
• Reliable! • Regular updates Customers / Users Site Ops YOW Management THE CODE Product Managers Developers QAs
YOW Tech choices are important because they can make people’s lives better
YOW
YOW
Programming languages existed before computers did Alan Turing Alonzo Church Turing machines The Lambda Calculus
Programs exist like numbers exist!
Last week’s hot Fundamental VS web framework software principles Every single day Next 6 months, if you’re Every language Applicability lucky Every problem Every context Eternal hamster wheel of Eternal and unchanging memorising steaming piles Substance fabric of the universe of human error Long-term Happiness, productivity & Quit and become a dentist consequence wisdom 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 Weekly guild meetings #functionalprogramming shared norms shared norms
shared norms shared norms Weekly guild meetings #functionalprogramming #sig-scala shared norms
shared norms shared norms Central expert group training sessions secondment advice code review articles support shared norms
Should my team use Scala? Hey do you mind helping out with some advice for my team? Sure! We’re thinking about using Scala for the new service …
Maybe We’ve got a couple of Scala devs, and the rest Maybe. Here’s of the team is keen. some options, tradeoffs etc... We want more maintainable assets. I can pay for an up-front learning curve.
ABSOLUTELY NOT 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?
Good signs Bad signs • Stable, established team • Unstable team • Existing FP/Scala experience • Nobody knows Scala/FP • Project can bear learning curve • Very tight deadlines • Good sentiment • Mixed or negative sentiment • Local developers • Offshore developers • Realistic expectations • “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! Hooray! Let’s Welcome! 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 … Is this really the right approach for us? Hmmm. Oof. This is all Not going to going a bit lie, this slower than we Scala/FP stuff thought … is tough
We have to help our I’ll run a weekly teammates! I’ll training make session! tutorials …
6 months later … Success! Love it! Devs are knocking Woohoo! down the door to join. Productivity! Great results. This Future though? software is rock solid!
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 Me neither wanted this tbh
Case study 3: Empathy FTW We do a lot of maintenance, quality matters. A lot of our stuff is I’m happy to already Scala. invest in our skills! We really want to learn. ?
Could you help us with some training? Sure, I can fit you in once/week!
It’s up to me to make sure my teammates are having a good time with this
Let’s keep it Good idea! simple …
val modifyBanana(b: Banana): Banana = ???
val modifyBanana(b: Oh man. Banana): Banana = ??? Let’s slow down! Struggling. I’ll help out.
Let’s keep track of out progress, to Weekly survey work out how How are you we’re doing! finding it? 1 5 Can you use technique X in anger? 1 5 etc
You’re doing val modifyBanana(b: great! We’ll all Banana): Banana = ??? help Still struggling.
6 months later … success! We’re really happy with this code! We’ve levelled Project was a up! success! Well done team!
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?? It looks weird and we didn’t sign up for this I never would have agreed to this!
Antipattern 2: Wizard Tower
Tense, fragile situation … Profunctor optics! Church-encoded free monad. Left Kan extension enriches our algebra into a Why on earth functor … ..etc would we care about all that?
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 Sure can! help us out? AgileConsultyCorp
Let’s add some AgileConsultyCorp pizzazz! This will never do!
FP Guild Every Wednesday 4pm without fail f ◦ (g ◦ h) = (f ◦ g) ◦ h
Recommend
More recommend