SlideShare a Scribd company logo
Challenges of moving
a Java team to Scala
João Cavalheiro
joao.cavalheiro@enear.co
About me
• 10 years professional experience as a developer
in multiple languages (from C to Java).
• Working at E.near, as a Systems Architect and
managing 3 Scala development teams.
Outline
• Why move a Java team to Scala?
• The challenges
• The good things
This is not about
• An introduction to Scala language.
• Convincing Java fans to move to Scala.
• Migrating Java code to Scala.
The motivation
• A customer asked us to take control of a big
Scala project (+200k lines of code), already in
production at the time.
• Time was short.
• We said we would do it!
• We needed the right team and a plan…
The right team
• Not every Java developer can be “converted” to
Scala.
• Although professional Scala experience is not
required, functional programming concepts are
a “must have”.
• Team members must embrace Scala - happy
engineers are essential.
Scala features that
sometimes scare Java
developers
And how to deal with them
Infix and Postfix operations
• object.operation(k) can be written as
“object operation k”
• object.operation can be written as
“object operation”.
• Try not to mix them with traditional object-
oriented programming language syntax.
High order functions
• These are functions that take other functions as
parameters, or whose result is a function.
• def hof(f: Int => String, v: Int) = f(v)
• Use them whenever it makes sense (and once
you feel comfortable with the concept).
Implicit conversions
• Given the declaration “implicit convert(a:A):B”.
• “convert” will be called behind the scenes
whenever you have an “A” and need a “B”.
• Don’t use it before you understand the
consequences.
How to start
Once you have the right people aboard
First steps
• Start by writing tests.
• Don’t feel guilty for using OO design in your first
days in Scala.
• You don't have to understand all the possibilities
when starting.
Build tools
• You can use Maven, but…
• SBT basics are easy to learn.
• Although not as mature as Maven, works better
with Scala.
• SBT supports incremental compilation out of the
box.
Scala ecosystem
• Typesafe activator
• The play framework
• Lots of online documentation:
• http://www.scala-lang.org/
• Stack overflow
Express yourself
• Simply express your intent.
• Write readable code. Shorter code is not always
a best option.
• There are lots of toys, try to use only the right
ones.
Things we loved about
Scala since the first day
And that made things easier
REPL
!
!
!
• REPL is an interactive Scala command line
interpreter.
• Awesome for doing experiments!
Tools, libs & runtime
environment
• Compiled Scala is like compiled Java -
Bytecode that runs on JVM.
• We can use all our favourite Java libs.
• We can use our favourite IDE (Scala / IntelliJ),
and the debugger works!
Class constructors
!
!
!
!
Pattern matching
!
!
!
!
Conclusions
• Myth: We don’t need frameworks.
• Myth: Java sucks, and Java coders aren’t as
smart as us.
• More concise code.
• Less time coding.
• Less bugs, if you do it right.

More Related Content

PPTX
Akkurate Akka
PDF
Jazoon2013 type script
PPTX
Elm - never get a runtime error anymore. Almost.
PPTX
Episode 16 - Introduction to LWC
PPTX
A tale of 3 databases
PPTX
Episode 19 - Asynchronous Apex - Batch apex & schedulers
PPTX
Adopting Elixir in a 10 year old codebase
PPTX
Episode 17 - Handling Events in Lightning Web Component
Akkurate Akka
Jazoon2013 type script
Elm - never get a runtime error anymore. Almost.
Episode 16 - Introduction to LWC
A tale of 3 databases
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Adopting Elixir in a 10 year old codebase
Episode 17 - Handling Events in Lightning Web Component

What's hot (20)

PDF
Scala in-practice-3-years by Patric Fornasier, Springr, presented at Pune Sca...
PDF
Can you TDD Rails?
PPTX
Tdd final submission
PPTX
Episode 2 conditional flows & loops
PPTX
Rails automatic test driven development
PPTX
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
PDF
Cassandra Summit 2014: Astyanax — To Be or Not To Be
PPTX
Episode 22 - Design Pattern 2
ZIP
The Big Wave of Indian Startups - Almost Effortless Entrepreneurship Using Ruby
PPTX
Airbnb Java Script style guide
PDF
An Introduction to jOOQ
PPTX
Developing Amazon Alexa Skills with the Go Programming Language
PDF
Reactive All the Way Down the Stack
PDF
London Atlassian User Group - February 2014
PDF
Voice Applications (Alexa Skills) Cloud Native on Kubernetes with Terraform
PDF
Agile Apps with App Engine
PPTX
Love your API with Swagger (Gluecon lightning talk)
PPT
Jira and Confluence - How the company behind those products works - Anatoli K...
PPT
Next generation frontend tooling
PDF
Greach 2018: Surviving Microservices
Scala in-practice-3-years by Patric Fornasier, Springr, presented at Pune Sca...
Can you TDD Rails?
Tdd final submission
Episode 2 conditional flows & loops
Rails automatic test driven development
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
Cassandra Summit 2014: Astyanax — To Be or Not To Be
Episode 22 - Design Pattern 2
The Big Wave of Indian Startups - Almost Effortless Entrepreneurship Using Ruby
Airbnb Java Script style guide
An Introduction to jOOQ
Developing Amazon Alexa Skills with the Go Programming Language
Reactive All the Way Down the Stack
London Atlassian User Group - February 2014
Voice Applications (Alexa Skills) Cloud Native on Kubernetes with Terraform
Agile Apps with App Engine
Love your API with Swagger (Gluecon lightning talk)
Jira and Confluence - How the company behind those products works - Anatoli K...
Next generation frontend tooling
Greach 2018: Surviving Microservices
Ad

Similar to Challenges of moving a java team to scala (20)

PDF
Scala Programming A comprehensive beginner s guide to Scala 2nd Edition Claud...
PPT
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
KEY
Java to Scala: Why & How
PPTX
Scala-Ls1
PPTX
Scala in practice
PDF
Infographic on Scala Programming Language
PDF
Lecture1
PPTX
Scala adoption by enterprises
PDF
Scala tutorial
PDF
Scala tutorial
PPTX
Introduction to Scala language
PPT
Why scala - executive overview
PDF
Get Programming with Scala MEAP V05 Daniela Sfregola
PDF
Scala - from "Hello, World" to "Heroku Scale"
PPTX
All about scala
PDF
Absorbing Scala Into Java Ecosystem
KEY
LSUG: How we (mostly) moved from Java to Scala
PPT
scala-intro
PDF
Scala for java developers 6 may 2017 - yeni
PPTX
The Evolution of Scala
Scala Programming A comprehensive beginner s guide to Scala 2nd Edition Claud...
Introducing Scala to your Ruby/Java Shop : My experiences at IGN
Java to Scala: Why & How
Scala-Ls1
Scala in practice
Infographic on Scala Programming Language
Lecture1
Scala adoption by enterprises
Scala tutorial
Scala tutorial
Introduction to Scala language
Why scala - executive overview
Get Programming with Scala MEAP V05 Daniela Sfregola
Scala - from "Hello, World" to "Heroku Scale"
All about scala
Absorbing Scala Into Java Ecosystem
LSUG: How we (mostly) moved from Java to Scala
scala-intro
Scala for java developers 6 may 2017 - yeni
The Evolution of Scala
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
medical staffing services at VALiNTRY
PPTX
Essential Infomation Tech presentation.pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Complete React Javascript Course Syllabus.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Understanding Forklifts - TECH EHS Solution
PPT
JAVA ppt tutorial basics to learn java programming
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Transform Your Business with a Software ERP System
PPTX
history of c programming in notes for students .pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
top salesforce developer skills in 2025.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
Internet Downloader Manager (IDM) Crack 6.42 Build 41
medical staffing services at VALiNTRY
Essential Infomation Tech presentation.pptx
Softaken Excel to vCard Converter Software.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Complete React Javascript Course Syllabus.pdf
How Creative Agencies Leverage Project Management Software.pdf
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Understanding Forklifts - TECH EHS Solution
JAVA ppt tutorial basics to learn java programming
Design an Analysis of Algorithms II-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Transform Your Business with a Software ERP System
history of c programming in notes for students .pptx
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Materi-Enum-and-Record-Data-Type (1).pptx
ai tools demonstartion for schools and inter college
top salesforce developer skills in 2025.pdf
ISO 45001 Occupational Health and Safety Management System

Challenges of moving a java team to scala

  • 1. Challenges of moving a Java team to Scala João Cavalheiro joao.cavalheiro@enear.co
  • 2. About me • 10 years professional experience as a developer in multiple languages (from C to Java). • Working at E.near, as a Systems Architect and managing 3 Scala development teams.
  • 3. Outline • Why move a Java team to Scala? • The challenges • The good things
  • 4. This is not about • An introduction to Scala language. • Convincing Java fans to move to Scala. • Migrating Java code to Scala.
  • 5. The motivation • A customer asked us to take control of a big Scala project (+200k lines of code), already in production at the time. • Time was short. • We said we would do it! • We needed the right team and a plan…
  • 6. The right team • Not every Java developer can be “converted” to Scala. • Although professional Scala experience is not required, functional programming concepts are a “must have”. • Team members must embrace Scala - happy engineers are essential.
  • 7. Scala features that sometimes scare Java developers And how to deal with them
  • 8. Infix and Postfix operations • object.operation(k) can be written as “object operation k” • object.operation can be written as “object operation”. • Try not to mix them with traditional object- oriented programming language syntax.
  • 9. High order functions • These are functions that take other functions as parameters, or whose result is a function. • def hof(f: Int => String, v: Int) = f(v) • Use them whenever it makes sense (and once you feel comfortable with the concept).
  • 10. Implicit conversions • Given the declaration “implicit convert(a:A):B”. • “convert” will be called behind the scenes whenever you have an “A” and need a “B”. • Don’t use it before you understand the consequences.
  • 11. How to start Once you have the right people aboard
  • 12. First steps • Start by writing tests. • Don’t feel guilty for using OO design in your first days in Scala. • You don't have to understand all the possibilities when starting.
  • 13. Build tools • You can use Maven, but… • SBT basics are easy to learn. • Although not as mature as Maven, works better with Scala. • SBT supports incremental compilation out of the box.
  • 14. Scala ecosystem • Typesafe activator • The play framework • Lots of online documentation: • http://www.scala-lang.org/ • Stack overflow
  • 15. Express yourself • Simply express your intent. • Write readable code. Shorter code is not always a best option. • There are lots of toys, try to use only the right ones.
  • 16. Things we loved about Scala since the first day And that made things easier
  • 17. REPL ! ! ! • REPL is an interactive Scala command line interpreter. • Awesome for doing experiments!
  • 18. Tools, libs & runtime environment • Compiled Scala is like compiled Java - Bytecode that runs on JVM. • We can use all our favourite Java libs. • We can use our favourite IDE (Scala / IntelliJ), and the debugger works!
  • 21. Conclusions • Myth: We don’t need frameworks. • Myth: Java sucks, and Java coders aren’t as smart as us. • More concise code. • Less time coding. • Less bugs, if you do it right.