SlideShare a Scribd company logo
John Nestor and Dragos Manolescu
{jnestor,dmanolescu}@whitepages.com
Whitepages Practical
Experience Converting from
Ruby to Reactive
August 13, 2014
Disclaimer
The following material is subjective and represents the views of
the presenters.
We hope our views and experience may be of use to others
making the transitive from Ruby to Scala, but your mileage may
vary.
May 15, 2013
Whitepages Typesafe Case Study
•  WhitePages Rebuilds Core Parts of Application Stack with
Scala and Akka to Improve Scaling.
•  http://j.mp/wpscala
May 15, 2013
Outline
• Background
• Technology
• People
May 15, 2013
Background
About Whitepages
•  Top web and mobile site for finding phones, people and locations.
•  50M unique users per month.
•  35M search queries per day.
•  70 engineers, mostly in Seattle.
May 15, 2013
Why replace Ruby?
Problems with Ruby legacy systems:
•  High latencies.
•  High resource consumption: memory and processors.
•  Poor tolerance of upstream degradation:
–  Limited concurrency.
–  Worker starvation when blocking on slow upstream.
–  Poor connection management and healing.
May 15, 2013
Why replace Ruby with Scala?
•  Elegant blend of Functional and OO paradigms.
•  Static type system:
•  Type inference avoids the excess boilerplate of Java.
•  Compiler catches many errors.
•  Runs on the JVM:
–  Fast.
–  Near seamless interop with JVM libraries.
–  Reasonably mature tooling support.
•  Actor-based concurrency framework: Akka.
May 15, 2013
Whitepages Reactive Services
•  Service-oriented-architecture where communication is Thrift
or Json over HTTP.
•  Both latency and throughput are very important.
•  We require excellent logging and monitoring.
•  Agility of development, testing, build and deployment provide
leverage and competitive advantage.
May 15, 2013
Performance
Results
Service p50 ms p99 ms Throughput RPS/core
DirSvc -
Scala 25 300 80
DirSvc -
Ruby 140 1200 7
May 15, 2013
Status of Reactive Scala Services
•  We have been using Scala for a little more than 1.5 years.
•  We started with 1 development team, we now have 4.
•  We started with a single back end service. We now have 4 services in
production and another 6 in development.
•  Our first project had 6 Scala developers, we now have over 20 Scala
developers.
•  We changed not only language but also tools (more automation) and
processes (more agile).
May 15, 2013
Future Reactive Work
•  Transition additional Ruby back-end services to Scala.
•  Exploring new technologies:
•  Spark and Mesos.
•  A messaging system based on Kafka.
•  A graph store based on Titan/Cassandra.
•  A deployment and lifecycle-management system based on
Docker that uses remote actors.
May 15, 2013
Technology
•  GitHub Enterprise
•  IntelliJ
•  Jenkins (for builds)
•  Artifactory
•  Yourkit
•  SCoverage
•  Scrooge (for thrift, from
Twitter)
•  Scala
•  Akka
•  Spray
•  SBT – with custom plugins
•  Typesafe Config
•  Scala Test
•  Coda Hale Metrics
•  Persist Json
Technology Selection
May 15, 2013
Whitepages Service Framework
•  Configuration (based on Typesafe Config, with multi-level overrides).
•  Monitoring (central actor that uses Coda Hale metrics and publishes to Graphite, Nagios
and Riemann).
•  Logging (custom system with central actor, Json log content and real time streaming to
external analytics).
•  Admin REST API.
•  REST Thrift/JSON Server (based on Spray).
•  Clients (Spray, JDBC, Redis, SOLR, Riak,… -- advanced error detection/ recovery).
May 15, 2013
Technology Successes
•  Scala concise syntax. – Higher developer productivity.
•  Use of async future based code. – Great performance.
•  Immutable collections and functional programming. – Fewer bugs.
•  Strong type checking. – Fewer bugs and more maintainable code (But meta-programming becomes
more difficult).
•  Concurrency. – No race conditions or deadlock on complex concurrent system.
•  Spray. – Great performance and an async API.
•  SBT. – Able to easily customize to our needs (after steep learning curve).
•  IntelliJ IDEA. – Scala support is good and keeps getting better.
•  Typesafe Developer support contract. – Fast response, great answers to complex questions. (We
should have gotten it earlier!)
May 15, 2013
Technology Problems -1
•  Poor documentation:
•  SBT is the poster child.
•  We still often have to read source code of Scala and Akka libraries.
•  Stable APIs:
•  Typesafe has made great strides here.
•  Other components are still troublesome.
•  We lost many weeks as a result of breaking changes in Scala Test.
•  We currently can’t compile a 2.11 version of Kafka because the Zinc Scala
compiler is not backward compatible.
May 15, 2013
Technology Problems -2
•  Performance analysis of concurrent constructs:
•  We went with the Typesafe Console.
•  It never fully worked and then was abandoned.
•  There are some new tools, but we have not had time to evaluate.
May 15, 2013
Technology Problems -3
•  Ecosystem:
•  Not as mature as the Java ecosystem and often missing Scala specific
features. For example, Scala Mock does not support named
parameters.
•  Some needed components were missing: until recently code coverage.
•  In some cases there were too many options: over 10 Json libraries.
•  Lots of Scala GitHub projects. Quality is variable; many become
abandoned.
May 15, 2013
Technology Problems -4
•  Debugging:
•  Debuggers work on the Java byte code, that for some Scala constructs
is quite convoluted.
•  Debugging chains of futures is much harder than debugging nested
calls. Some kind of tracing is desperately needed.
•  Actors have lots of power but can be exceptionally hard to debug. We
need both better approaches to building debug-able actors and better
debugging tools.
May 15, 2013
Technology Problems -5
•  Language and Library Issues:
•  Type erasure is a major flaw in the Scala language. It causes lots of
developer confusion and errors. The workarounds are awkward at
best.
•  The lack of type checking on Actor constructors is an odd hole in the
type checking and a real annoyance.
•  Some Scala code that looks simple and intuitive creates major
difficulties when a developer needs to understand what is really going
on. Implicits are one of many problems here.
May 15, 2013
Technology Overall
•  The problems mentioned above create real day to day difficulties.
•  In many cases Typesafe has been actively working to incrementally
correct some of these problems.
•  Since we started using Scala, the number of problems has significantly
decreased and we expect that trend to continue.
•  Overall, Scala/Akka is a great technology for building reactive systems
and its benefits far outweigh the problems.
May 15, 2013
People
Levels of Scala Expertise
•  Basic OO features. Easy transition from most other languages including
Java and Ruby.
•  Adding functional. Ruby has functional features that are similar. But
knowing when best to use functional versus OO requires experience.
•  Adding concurrency. Via futures, promises, and actors. A whole new world
for Ruby programmers that requires a new way of thinking.
•  API design. Not all developers need to design reusable APIs, but those that
do need a higher level of experience and feature mastery to do it well.
May 15, 2013
Building Scala Development Teams
•  The are still not a large number of experienced Scala developers.
•  Those out there are in considerable demand.
•  We have followed a mixed strategy of both recruiting Scala developers and
also training existing Ruby developers to become Scala developers.
•  Having an experienced Scala developer greatly accelerated the training of
Ruby developers.
Note: Using Scala, Akka and other advanced technologies makes Whitepages
very attractive to some of the very best developers.
May 15, 2013
Recruiting: Finding Developers
•  Personal contacts. The best way to find great developers.
•  Meet-ups and Events
•  John Nestor is the organizer for the Seattle Scala meet-up.
•  Whitepages hosts the Scala meet-up (and several others)
•  Whitepages sponsors many other technology conferences and events.
•  Job posts: local Seattle and internet Scala focused.
•  College recruiting events. UW and other top CS schools.
May 15, 2013
Recruiting: Attracting Developers
•  Strong support from the Whitepages CTO and CEO and other management for Scala
and other advanced technologies.
•  We have a great office (recently completely redone)
•  We provide developers with the best workstations (top-end MacBook pros).
•  We have competitive benefits, excellent work-life balance and a collaborative
supportive culture.
May 15, 2013
Training: External Resources
•  Books. Odersky: Programming in Scala, and others
•  Coursera. Functional programming, reactive programming.
•  Typesafe training classes. Both Seattle public and in-house.
•  Typesafe developer support contract and consulting. Particularly valuable
if you don’t have in-house Scala expertise.
•  Conferences. We sent people to Scala Days in NY and Berlin.
May 15, 2013
Training: Internal Resources
•  Whitepages developers are in a single office and come in most days.
•  This permits a high degree of personal interactions.
•  Those interactions enable rapid learning and high code quality.
•  This would be much harder with multiple offices and/or widely distributed
teams.
May 15, 2013
Training: Internal Approaches
•  Expert mentoring.
•  Provide quick answers to questions.
•  Detailed reviews and feedback for Ruby developers initial Scala code.
•  Code reviews
•  Improve code quality.
•  Help those learning Scala.
•  Develop a shared culture and style.
•  We use a mixture of group and pair code reviews.
•  Electronic means like code review tools and pull requests were less effective.
May 15, 2013
Training: Success and Failure
•  Not everyone made a successful transition from Ruby to Scala.
•  Next slide give some positive and negative indicators…
May 15, 2013
Training: What to Look For
•  Desire to learn new technologies.
•  Desire to learn new ways to think.
•  Prior functional language experience.
•  Likes to work closely with others.
May 15, 2013
Scala Features to Avoid
•  Scala is a very large language.
•  New developers can easily get lost on the rich feature set. Often there are
several different ways of doing something, and they don’t always know
how to choose.
–  We also provide the following list of features for new developers to
avoid (or to fully understand before using).
–  We encourage asking more experienced developers to provide that
understanding.
–  These features are also flags for discussion in code reviews.
May 15, 2013
•  Reflection and macros
•  asInstanceOf
•  Top level objects with mutable
state
•  Lazy vals
•  Scala enumerations
•  ? (the ask pattern)
•  onComplete (unless body
enclosed in try)
•  Nulls
•  Return, break, continue
•  Mutable collections
•  var, while, until
•  Generics
•  Implicits
•  Actors
•  Await
Scala Features to Avoid
May 15, 2013
We Are Hiring*!
May 2013
*Smart people (not just technologies) are key to our success
Thank you!
Questions?

More Related Content

What's hot (20)

KEY
Modern Java Concurrency (OSCON 2012)
Martijn Verburg
 
KEY
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
 
PDF
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
IncQuery Labs
 
PDF
Reactive All the Way Down the Stack
Steve Pember
 
DOC
Resume
Mina k
 
KEY
SSJS, NoSQL, GAE and AppengineJS
Eugene Lazutkin
 
PDF
Laravel and Django and Rails, Oh My!
Chris Roberts
 
PPTX
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
AD1545 - Extending the XPages Extension Library
paidi_ed
 
PDF
Greach 2018: Surviving Microservices
Steve Pember
 
PDF
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
KEY
Free community with deep roots
Martijn Verburg
 
PDF
Serverless Meetup - 12 gennaio 2017
Luca Bianchi
 
PPTX
Cucumber jvm best practices v3
Ahmed Misbah
 
ZIP
Staging and Deployment
heyrocker
 
PDF
PHP Frameworks Review - Mar 19 2015
kyphpug
 
PDF
Scala services in action
Underscore
 
PDF
SGCE 2015 REST APIs
Domingo Suarez Torres
 
PPTX
Be faster then rabbits
Vladislav Bauer
 
PDF
JavaCro'15 - HUJAKing – Expansion of Java Community - Branko Mihaljević, Alek...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Modern Java Concurrency (OSCON 2012)
Martijn Verburg
 
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
 
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
IncQuery Labs
 
Reactive All the Way Down the Stack
Steve Pember
 
Resume
Mina k
 
SSJS, NoSQL, GAE and AppengineJS
Eugene Lazutkin
 
Laravel and Django and Rails, Oh My!
Chris Roberts
 
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
AD1545 - Extending the XPages Extension Library
paidi_ed
 
Greach 2018: Surviving Microservices
Steve Pember
 
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Free community with deep roots
Martijn Verburg
 
Serverless Meetup - 12 gennaio 2017
Luca Bianchi
 
Cucumber jvm best practices v3
Ahmed Misbah
 
Staging and Deployment
heyrocker
 
PHP Frameworks Review - Mar 19 2015
kyphpug
 
Scala services in action
Underscore
 
SGCE 2015 REST APIs
Domingo Suarez Torres
 
Be faster then rabbits
Vladislav Bauer
 
JavaCro'15 - HUJAKing – Expansion of Java Community - Branko Mihaljević, Alek...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 

Similar to Experience Converting from Ruby to Scala (20)

PPTX
Scala adoption by enterprises
Mike Slinn
 
PPTX
Scala in practice
Tomer Gabel
 
PPT
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Manish Pandit
 
PDF
WTFAST Crack Latest Version FREE Downlaod 2025
channarbrothers93
 
PDF
uTorrent Pro Crack Latest Version free 2025
channarbrothers93
 
PDF
Adobe Master Collection CC Crack 2025 FREE
arslanyounus93
 
PDF
AOMEI Partition Assistant Crack 2025 FREE
yazdanwaqar
 
PPTX
Evolving Scala, Scalar conference, Warsaw, March 2025
Martin Odersky
 
PDF
K7 Total Security 16.0.1260 Crack + License Key Free
birbaahan
 
PPTX
Ruby to Scala in 9 weeks
jutley
 
PPT
The State of Scala
Boston Area Scala Enthusiasts
 
PDF
Building Applications with Scala 1st Edition Pacheco
waldalowey4n
 
PPTX
From java to scala at crowd mix
Stefano Galarraga
 
PDF
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
KEY
Java to Scala: Why & How
Graham Tackley
 
PDF
How to keep maintainability of long life Scala applications
takezoe
 
KEY
Scala
sryx
 
ZIP
Why Scala Presentation
guestc185e0e
 
PDF
Reactive Software Systems
Behrad Zari
 
PDF
Scala Days Highlights | BoldRadius
BoldRadius Solutions
 
Scala adoption by enterprises
Mike Slinn
 
Scala in practice
Tomer Gabel
 
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Manish Pandit
 
WTFAST Crack Latest Version FREE Downlaod 2025
channarbrothers93
 
uTorrent Pro Crack Latest Version free 2025
channarbrothers93
 
Adobe Master Collection CC Crack 2025 FREE
arslanyounus93
 
AOMEI Partition Assistant Crack 2025 FREE
yazdanwaqar
 
Evolving Scala, Scalar conference, Warsaw, March 2025
Martin Odersky
 
K7 Total Security 16.0.1260 Crack + License Key Free
birbaahan
 
Ruby to Scala in 9 weeks
jutley
 
The State of Scala
Boston Area Scala Enthusiasts
 
Building Applications with Scala 1st Edition Pacheco
waldalowey4n
 
From java to scala at crowd mix
Stefano Galarraga
 
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
Java to Scala: Why & How
Graham Tackley
 
How to keep maintainability of long life Scala applications
takezoe
 
Scala
sryx
 
Why Scala Presentation
guestc185e0e
 
Reactive Software Systems
Behrad Zari
 
Scala Days Highlights | BoldRadius
BoldRadius Solutions
 
Ad

More from John Nestor (8)

PDF
LambdaFlow: Scala Functional Message Processing
John Nestor
 
PDF
LambdaTest
John Nestor
 
PDF
Type Checking Scala Spark Datasets: Dataset Transforms
John Nestor
 
PDF
Logging in Scala
John Nestor
 
PDF
Messaging patterns
John Nestor
 
PPTX
Scala and Spark are Ideal for Big Data
John Nestor
 
PDF
Scala Json Features and Performance
John Nestor
 
PPT
Neutronium
John Nestor
 
LambdaFlow: Scala Functional Message Processing
John Nestor
 
LambdaTest
John Nestor
 
Type Checking Scala Spark Datasets: Dataset Transforms
John Nestor
 
Logging in Scala
John Nestor
 
Messaging patterns
John Nestor
 
Scala and Spark are Ideal for Big Data
John Nestor
 
Scala Json Features and Performance
John Nestor
 
Neutronium
John Nestor
 
Ad

Recently uploaded (20)

PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
How Cloud Computing is Reinventing Financial Services
Isla Pandora
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
How Cloud Computing is Reinventing Financial Services
Isla Pandora
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 

Experience Converting from Ruby to Scala

  • 1. John Nestor and Dragos Manolescu {jnestor,dmanolescu}@whitepages.com Whitepages Practical Experience Converting from Ruby to Reactive August 13, 2014
  • 2. Disclaimer The following material is subjective and represents the views of the presenters. We hope our views and experience may be of use to others making the transitive from Ruby to Scala, but your mileage may vary. May 15, 2013
  • 3. Whitepages Typesafe Case Study •  WhitePages Rebuilds Core Parts of Application Stack with Scala and Akka to Improve Scaling. •  http://j.mp/wpscala May 15, 2013
  • 6. About Whitepages •  Top web and mobile site for finding phones, people and locations. •  50M unique users per month. •  35M search queries per day. •  70 engineers, mostly in Seattle. May 15, 2013
  • 7. Why replace Ruby? Problems with Ruby legacy systems: •  High latencies. •  High resource consumption: memory and processors. •  Poor tolerance of upstream degradation: –  Limited concurrency. –  Worker starvation when blocking on slow upstream. –  Poor connection management and healing. May 15, 2013
  • 8. Why replace Ruby with Scala? •  Elegant blend of Functional and OO paradigms. •  Static type system: •  Type inference avoids the excess boilerplate of Java. •  Compiler catches many errors. •  Runs on the JVM: –  Fast. –  Near seamless interop with JVM libraries. –  Reasonably mature tooling support. •  Actor-based concurrency framework: Akka. May 15, 2013
  • 9. Whitepages Reactive Services •  Service-oriented-architecture where communication is Thrift or Json over HTTP. •  Both latency and throughput are very important. •  We require excellent logging and monitoring. •  Agility of development, testing, build and deployment provide leverage and competitive advantage. May 15, 2013
  • 10. Performance Results Service p50 ms p99 ms Throughput RPS/core DirSvc - Scala 25 300 80 DirSvc - Ruby 140 1200 7 May 15, 2013
  • 11. Status of Reactive Scala Services •  We have been using Scala for a little more than 1.5 years. •  We started with 1 development team, we now have 4. •  We started with a single back end service. We now have 4 services in production and another 6 in development. •  Our first project had 6 Scala developers, we now have over 20 Scala developers. •  We changed not only language but also tools (more automation) and processes (more agile). May 15, 2013
  • 12. Future Reactive Work •  Transition additional Ruby back-end services to Scala. •  Exploring new technologies: •  Spark and Mesos. •  A messaging system based on Kafka. •  A graph store based on Titan/Cassandra. •  A deployment and lifecycle-management system based on Docker that uses remote actors. May 15, 2013
  • 14. •  GitHub Enterprise •  IntelliJ •  Jenkins (for builds) •  Artifactory •  Yourkit •  SCoverage •  Scrooge (for thrift, from Twitter) •  Scala •  Akka •  Spray •  SBT – with custom plugins •  Typesafe Config •  Scala Test •  Coda Hale Metrics •  Persist Json Technology Selection May 15, 2013
  • 15. Whitepages Service Framework •  Configuration (based on Typesafe Config, with multi-level overrides). •  Monitoring (central actor that uses Coda Hale metrics and publishes to Graphite, Nagios and Riemann). •  Logging (custom system with central actor, Json log content and real time streaming to external analytics). •  Admin REST API. •  REST Thrift/JSON Server (based on Spray). •  Clients (Spray, JDBC, Redis, SOLR, Riak,… -- advanced error detection/ recovery). May 15, 2013
  • 16. Technology Successes •  Scala concise syntax. – Higher developer productivity. •  Use of async future based code. – Great performance. •  Immutable collections and functional programming. – Fewer bugs. •  Strong type checking. – Fewer bugs and more maintainable code (But meta-programming becomes more difficult). •  Concurrency. – No race conditions or deadlock on complex concurrent system. •  Spray. – Great performance and an async API. •  SBT. – Able to easily customize to our needs (after steep learning curve). •  IntelliJ IDEA. – Scala support is good and keeps getting better. •  Typesafe Developer support contract. – Fast response, great answers to complex questions. (We should have gotten it earlier!) May 15, 2013
  • 17. Technology Problems -1 •  Poor documentation: •  SBT is the poster child. •  We still often have to read source code of Scala and Akka libraries. •  Stable APIs: •  Typesafe has made great strides here. •  Other components are still troublesome. •  We lost many weeks as a result of breaking changes in Scala Test. •  We currently can’t compile a 2.11 version of Kafka because the Zinc Scala compiler is not backward compatible. May 15, 2013
  • 18. Technology Problems -2 •  Performance analysis of concurrent constructs: •  We went with the Typesafe Console. •  It never fully worked and then was abandoned. •  There are some new tools, but we have not had time to evaluate. May 15, 2013
  • 19. Technology Problems -3 •  Ecosystem: •  Not as mature as the Java ecosystem and often missing Scala specific features. For example, Scala Mock does not support named parameters. •  Some needed components were missing: until recently code coverage. •  In some cases there were too many options: over 10 Json libraries. •  Lots of Scala GitHub projects. Quality is variable; many become abandoned. May 15, 2013
  • 20. Technology Problems -4 •  Debugging: •  Debuggers work on the Java byte code, that for some Scala constructs is quite convoluted. •  Debugging chains of futures is much harder than debugging nested calls. Some kind of tracing is desperately needed. •  Actors have lots of power but can be exceptionally hard to debug. We need both better approaches to building debug-able actors and better debugging tools. May 15, 2013
  • 21. Technology Problems -5 •  Language and Library Issues: •  Type erasure is a major flaw in the Scala language. It causes lots of developer confusion and errors. The workarounds are awkward at best. •  The lack of type checking on Actor constructors is an odd hole in the type checking and a real annoyance. •  Some Scala code that looks simple and intuitive creates major difficulties when a developer needs to understand what is really going on. Implicits are one of many problems here. May 15, 2013
  • 22. Technology Overall •  The problems mentioned above create real day to day difficulties. •  In many cases Typesafe has been actively working to incrementally correct some of these problems. •  Since we started using Scala, the number of problems has significantly decreased and we expect that trend to continue. •  Overall, Scala/Akka is a great technology for building reactive systems and its benefits far outweigh the problems. May 15, 2013
  • 24. Levels of Scala Expertise •  Basic OO features. Easy transition from most other languages including Java and Ruby. •  Adding functional. Ruby has functional features that are similar. But knowing when best to use functional versus OO requires experience. •  Adding concurrency. Via futures, promises, and actors. A whole new world for Ruby programmers that requires a new way of thinking. •  API design. Not all developers need to design reusable APIs, but those that do need a higher level of experience and feature mastery to do it well. May 15, 2013
  • 25. Building Scala Development Teams •  The are still not a large number of experienced Scala developers. •  Those out there are in considerable demand. •  We have followed a mixed strategy of both recruiting Scala developers and also training existing Ruby developers to become Scala developers. •  Having an experienced Scala developer greatly accelerated the training of Ruby developers. Note: Using Scala, Akka and other advanced technologies makes Whitepages very attractive to some of the very best developers. May 15, 2013
  • 26. Recruiting: Finding Developers •  Personal contacts. The best way to find great developers. •  Meet-ups and Events •  John Nestor is the organizer for the Seattle Scala meet-up. •  Whitepages hosts the Scala meet-up (and several others) •  Whitepages sponsors many other technology conferences and events. •  Job posts: local Seattle and internet Scala focused. •  College recruiting events. UW and other top CS schools. May 15, 2013
  • 27. Recruiting: Attracting Developers •  Strong support from the Whitepages CTO and CEO and other management for Scala and other advanced technologies. •  We have a great office (recently completely redone) •  We provide developers with the best workstations (top-end MacBook pros). •  We have competitive benefits, excellent work-life balance and a collaborative supportive culture. May 15, 2013
  • 28. Training: External Resources •  Books. Odersky: Programming in Scala, and others •  Coursera. Functional programming, reactive programming. •  Typesafe training classes. Both Seattle public and in-house. •  Typesafe developer support contract and consulting. Particularly valuable if you don’t have in-house Scala expertise. •  Conferences. We sent people to Scala Days in NY and Berlin. May 15, 2013
  • 29. Training: Internal Resources •  Whitepages developers are in a single office and come in most days. •  This permits a high degree of personal interactions. •  Those interactions enable rapid learning and high code quality. •  This would be much harder with multiple offices and/or widely distributed teams. May 15, 2013
  • 30. Training: Internal Approaches •  Expert mentoring. •  Provide quick answers to questions. •  Detailed reviews and feedback for Ruby developers initial Scala code. •  Code reviews •  Improve code quality. •  Help those learning Scala. •  Develop a shared culture and style. •  We use a mixture of group and pair code reviews. •  Electronic means like code review tools and pull requests were less effective. May 15, 2013
  • 31. Training: Success and Failure •  Not everyone made a successful transition from Ruby to Scala. •  Next slide give some positive and negative indicators… May 15, 2013
  • 32. Training: What to Look For •  Desire to learn new technologies. •  Desire to learn new ways to think. •  Prior functional language experience. •  Likes to work closely with others. May 15, 2013
  • 33. Scala Features to Avoid •  Scala is a very large language. •  New developers can easily get lost on the rich feature set. Often there are several different ways of doing something, and they don’t always know how to choose. –  We also provide the following list of features for new developers to avoid (or to fully understand before using). –  We encourage asking more experienced developers to provide that understanding. –  These features are also flags for discussion in code reviews. May 15, 2013
  • 34. •  Reflection and macros •  asInstanceOf •  Top level objects with mutable state •  Lazy vals •  Scala enumerations •  ? (the ask pattern) •  onComplete (unless body enclosed in try) •  Nulls •  Return, break, continue •  Mutable collections •  var, while, until •  Generics •  Implicits •  Actors •  Await Scala Features to Avoid May 15, 2013
  • 35. We Are Hiring*! May 2013 *Smart people (not just technologies) are key to our success