Ola Kunysz is a programmer with 11 years of experience in software engineering, going it's through all stages, from business analysis to backend programming. Her biggest interest is solving real-life problems and writing code that matters.
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?
Case class is your friend
- Currying, higher order functions
- Immutable collections
- Rich collections API
- Option, Future, Either, Seq...
Lots of cool things you already know
Lots of not so common concepts you will like
- Type classes
- Streams, lazy structures
science => business
def learnNew(style:Paradigm = Paradigm("imperative"))
Functional programming in underground since 50s,
now brought to mainstream
Why do I care?
Where is Scala today?
* 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
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
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
- 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
- algorithm pattern
- decorator pattern
- strategy pattern
- adapter pattern
You get that all thanks to the function being an ordinary value
Who said Scala cannot duck type?
You will need
Good inter-team communication
Scala is dead
good CR/QA automated process
software engineering fundamentals
The most elegant code
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 for Java developer
- Scala has variables too
- Scala is compatible with Java libraries
- builtin Java->Scala converters for collections
- OO in Scala is like Java but cooler
- 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?
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
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 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...
Why you should (not) use Scala on production
By Ola Kunysz