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