Why you should (not) use Scala in your project

Ola Kunysz & Konrad Zdanowicz

Wrocław Nov 23rd 2016

What is Scala


You already know that well

Scala in a nutshell

  • dynamic typing?
  • weak typing?

Scala REPL


Case class is your friend

Pattern matching


  • Lambdas
  • Currying, higher order functions
  • Immutable collections
  • Rich collections API
  • flatMap everything
    • Option, Future, Either, Seq...

Lots of cool things you already know

Lots of not so common concepts you will like


  • For-comprehensions
  • Type classes
  • Streams, lazy structures
  • Implicits

Functional programming

Scala peregrination:

science => business



def learnNew(style:Paradigm = Paradigm("imperative"))

Functional programming in underground since 50s,

now brought to mainstream

by Scala

Why do I care?

Where is Scala today?



Koryto rozczarowania

* hype boom

* reflection - did we really need Scala?!

* way easier when you have a mentor

What you may not like

no backwards compatibility



Tooling: Compile time, not perfect IDE support and integration

Learning curve

Not foolproof?

Lack of enough experience in the industry

Job security patterns (even unintentional)

You'll feel you don't know a thing

but then you accept it and the life is easier when the expectations are lower

Compile time


Conversations about category theory


A2*/L1** Scala dev

Being good enough

* Level A2: Intermediate application programmer

** Level L1: Junior library designer

  • [Simplic, Flexibil, Scalabil]+ ity
  • REPL
  • One class != one file (?)
  • No NPE!*
  • Defensive programming done for you

You will like

You will not need design patterns

16 out of the 23 design patterns found in the GOF book are invisible or simpler in dynamic languages



Dependency injection 

Cake pattern

  • algorithm pattern
  • decorator pattern
  • strategy pattern
  • adapter pattern
  • ???

Not enough?

You get that all thanks to the function being an ordinary value  

Who said Scala cannot duck type?

You will need

Style consistency

and discipline

Good inter-team communication

Scala is dead

It sucks

 good CR/QA automated process


software engineering fundamentals


FP feeling

Good mentor

The most elegant code

 is useless

if it’s not maintainable.

Now you choose 

Our applications are no longer simple forms sitting in front of database tables,

they’re invaluable tools that help us

get shit done in our daily lives.


Good Scala applications

  • middleware services
  • telecom (Erlang roots)
  • data processing (Scala is the new Cobol?)
  • stateless (high-traffic) web services
  • *machine learning (need your opinion)
  • developing Scala compiler :)

Less good Scala applications

  • MVPs, proof of concepts (unless you sleep talk Scala)
  • enterprise projects with a limited control
  • mental legacyness environment
  • simple CRUDs

Bad Scala applications?

Interesting Scala applications

  • Scala.JS
  • Android?
  • Native?

Scala for Java developer

  • http://javatoscala.com/
  • Scala has variables too
  • Scala is compatible with Java libraries
  • builtin Java->Scala converters for collections
  • OO in Scala is like Java but cooler
    • traits
    • multiple inheritance
    • objects, classes, case classes

Java 8 > Scala

You don't need Scala, when all you care is:

  • Arrow functions
  • functional interface for collections
  • compiler and static type check
  • options, futures

FP in Java 8 is fun, limited and noisy,

but still possible and fun

Anybody with Java 8 and Scala exp can relate?

- me

PHP/NodeJS/Python/Ruby -> Scala

  • Mind shift towards the static typing
  • Less tests needed to make sure the code works
  • *Native* multithreading is a breeze
  • Play! is your Rails, Spray is your Express
  • Syntax is easier than it may seem

Enterprise -> Scala?

  • Mainstream languages development converges into better functional programming support


programming languages support for FP

pure FP



Where is your language?


recently introduced classes!

20% of Scala features

The rest 80% of Scala features I don't understand

Scala code I see in real projects chart

Scala is not a functional programming language only

Scala is

Scala is so much more

when you notice its OO support



Programming in Scala (Odersky, Spoon, and Venners)


Functional Programming in Scala ( Chiusano and Bjarnason)


Learn You a Haskell  http://learnyouahaskell.com


Transitioning to Scala

5 years of Scala and counting...


We recommend:

Thank you

Why you should (not) use Scala on production

By Ola Kunysz

Why you should (not) use Scala on production

  • 1,037
Loading comments...

More from Ola Kunysz