ME AND SCALAGarwan ConsultingScala experience - 2 yearsBackend and frontend applicationsPlay framework and Akka frameworkCo-organizing Slovak Scala users group
WHAT IS SCALA?Object-Oriented Meets Functional
pure functionstail recursionsfunction literalsimmutable data structures
WHO USES SCALA?
WHY YOU SHOULD TRYSCALA?
TYPE INFERENCEthat does not suck
JAVA COMPATIBILITYcall Java methods, inherit from Java classes and vice versa
POWERFUL CONCURRENCYas simple as possible
FIRST-CLASS FUNCTIONSbecause we are classy people :)
EXPRESSIONS EVERYWHERE!val c = if (b > 0) "big" else "small"
MATURE ECOSYSTEMthat keeps evolving
PATTERN MATCHINGcase statements on steroids
PATTERN MATCHINGx match { case 1 => "one" case b: Int => "two" case _ => "many"}
if(x.isInstanceOf[Int]) if( x == 1) "one" else "two"else "many"
PART 1 : BASIC EXAMPLES
YOU CAN MATCH:constants, variablessequences, tuplesany sort of datafirst-match policy
PART 2 : MORECOMPLICATED PATTERN
MATCHES
YOU CAN MATCH:case classes, option values, sequencesgreat for recursive datause of pattern guardsassign variables
PART 3 : PATTERNSEVERYWHERE
YOU CAN USE PATTERN MATCHING:in variable definitionsfor expressionserror handling
PART 4 : EXTRACTORS
WHAT ELSE?patterns can be decoupled from object's representationextracting values