SlideShare une entreprise Scribd logo
1  sur  70
Télécharger pour lire hors ligne
7 years of Scala
and counting
Scala Days Vienna 2017
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
6 years of Scala
and counting
Scala Vienna User Group May 2016
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Agenda
1. Quick introduction to Scala
2. Learning Scala
3. Using Scala
4. Learnings, reflection, observations, impressions
5. Questions
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Manuel Bernhardt
• I help companies getting started
with using reactive applications in
their distributed systems
infrastructure
• http://manuel.bernhardt.io
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Manuel Bernhardt
• I help companies getting started
with using reactive applications in
their distributed systems
infrastructure
• http://manuel.bernhardt.io
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala: an introduction
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala introduction
• first version released in 2003
• Martin Oderksy, EPFL
• an estimated more than half a
million Scala developers 1
1
http://www.scala-lang.org/blog/2016/03/14/announcing-the-scala-
center.html
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Center
• non-for-profit foundation for Scala
education and community
guidance
• established at EPFL
• founding members: IBM, verizon,
Goldman Sachs, nitro, Lightbend
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Favourite Feature tour
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
case classes
public class User {
private final String name;
private final String surname;
private final Integer age;
public User(String name, String surname, Integer age) {
this.name = name;
this.surname = surname;
this.age = age;
}
public String getName() {
return this.name;
}
public String getSurname() {
return this.surname;
}
public String getAge() {
return this.age;
}
@Override public int hashCode() {
// ...
}
@Override public boolean equals(Object that) {
// ...
}
}
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
case classes
case class User(name: String, surname: String, age: Int)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
case classes
case class User(name: String, surname: String, age: Int)
val bob = User("Bob", "Marley", 42)
val namedBob = User(name = "Bob", surname = "Marley", age = 22)
val john = bob.copy(name = "John")
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
case class
• perfect example of the terseness Scala provides
• hashcode, equals, toString for free
• serializable by default
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
type inference
val foo = "Bar" // foo: String = Bar
val answer = 42 // answer: Int = 42
val price = 9.99 // price: Double = 9.99
val nums = List(1, 2, 3) // nums: List[Int] = List(1, 2, 3)
val map = Map("abc" -> List(1, 2, 3))
// map: scala.collection.immutable.Map[String,List[Int]] = Map(abc -> List(1, 2, 3))
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
functions and higher-order
functions
def isMajor(user: User): Boolean = user.age > 18
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
functions and higher-order
functions
def isMajor(user: User): Boolean = user.age > 18
class UserGroup {
def filter(predicate: User Boolean): List[User] = ...
}
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
functions and higher-order
functions
def isMajor(user: User): Boolean = user.age > 18
class UserGroup {
def filter(predicate: User Boolean): List[User] = ...
}
userGroup.filter(isMajor) // returns only majors
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning Scala
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
How "learnable" is
Scala?
• Shadaj Laddad
• http://shadaj.me
• learned Scala at age 11-12
• talks at Scala Days, OSCON since
2012
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
How "learnable" is
Scala?
• Coursera courses, 400.000+
participants - highest completation
rate in the industry (10%, which is
high for a MOOC 2
)
• Scala as beginner programming
language at Lund University of
Technology 3
3
https://www.lth.se/english/about-lth/news/news/article/scala-will-be-the-
beginner-programming-language-of/
2
Massive Open Online Course
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
My learning path
• 2010: started dabbling with Scala
(books, using it in tests, small
projects)
• 2011: discovering Functional
Programming through Javascript.
Using Play Framework 1 with the
Scala module in my 2nd
startup
• 2012: first large codebase to
migration from Play 1 to Play 2.0.0
(based entirely on Scala)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
My learning path
• 2013: several client projects using Scala
• 2014-2016: architecture, prototyping, design,
implementation, review of various production systems with
Scala, Akka, Play Framework; writing Reactive Web
Applications
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
My learning path
• estimated 6 months to "click"
• imperative declarative
• mutable, global state immutable, expression-oriented
• longer to grasp or use more advanced concepts
• and how not to shoot myself in the foot with them
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Your learning path?
• new Coursera courses by the Scala Center
• https://scala.epfl.ch
• try to use Scala for something "real"
• and even if it is just tests in a real project
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Using Scala
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
6 years without one of those
pesky NullPointerException-s
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Significantly less
problems at
runtime
• Scala compiler spots a whole
plethora of problems at compile-
time
• leveraged by e.g. Play Framework,
high emphasis on "compiling
everything"
• URLs
• Javascript (Google Clojure
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Less code yields
higher maintainbility
(Less is more)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
IDE / Editors
• IntelliJ IDEA
• Scala IDE for Eclipse
• ENSIME 5
• emacs, Atom, Sublime Text, vim
5
Enhanced Scala and java Interaction Mode for text Editors
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Compiler
• slower than the Java compiler
• but not a problem (anymore) on modern hardware
• especially with incremental compilation
• unless you deep dive into type-level and generic
programming (e.g. shapeless library)
• much more precise than the Java compiler (type-safe ++)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Jobs & Developers
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
http://appliedscala.com/blog/2016/scala-popularity/
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
What I've learned
Reflection, Impressions, (Advice)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
The Dreyfus model of skill
acquisition
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning #1
Spend a little time understanding
the language design
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Understand Scala's essence
and your life will be easier
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning #2
Understand the purpose of the
language features
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala has quite a few language features
because it was designed to be extensible
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Don't be that kid
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala language levels 4
• Level A1: Beginning application programmer
• Level A2: Intermediate application programmer
• Level A3: Expert application programmer
4
http://www.scala-lang.org/old/node/8610
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala language levels 4
• Level L1: Junior library designer
• Level L2: Senior library designer
• Level L3: Expert library designer
4
http://www.scala-lang.org/old/node/8610
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
The features you need to build
applications
are not the same
as the ones you need to build
librariesScala Vienna May 2016 - manuel.bernhardt.io - @elmanu
SIP 18: Modularizing language
features
import scala.language.implicitConversions
import scala.language.dynamics
import scala.language.postfixOps
import scala.language.reflectiveCalls
import scala.language.higherKinds
import scala.language.existentials
import scala.language.macros
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Incidental complexity
Is this really a problem
specific to Scala?
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
@SuppressWarnings({"unchecked", "rawtypes"})
@Deprecated
@OneToMany(@HowManyDBADoYouNeedToChangeALightBulb)
@OneToManyMore @AnyOne @AnyBody
@YouDoNotTalkAboutOneToMany // Fightclub, LOL
@TweakThisWithThat(
tweak = {
@TweakID(name = "id", preferredValue = 1839),
@TweakID(name = "test", preferredValue = 839),
@TweakID(name = "test.old", preferredValue = 34),
},
inCaseOf = {
@ConditionalXMLFiltering(run = 5),
}
)
@ManyToMany @Many @AnnotationsTotallyRock @DeclarativeProgrammingRules @NoMoreExplicitAlgorithms
@Fetch @FetchMany @FetchWithDiscriminator(name = "no_name")
@SeveralAndThenNothing @MaybeThisDoesSomething
@JoinTable(joinColumns = {
@JoinColumn(name = "customer_id", referencedColumnName = "id")
})
@DoesThisEvenMeanAnything @DoesAnyoneEvenReadThis
@PrefetchJoinWithDiscriminator @JustTrollingYouKnow @LOL
@IfJoiningAvoidHashJoins @ButUseHashJoinsWhenMoreThan(records = 1000)
@XmlDataTransformable @SpringPrefechAdapter
private Collection employees; // http://annotatiomania.com
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning #3
Don't forget all about Object
Oriented Programming
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
class SynchronizationService {
private[services] def synchronizeTeeTimes(
suite: Suite,
dataType: SuiteDataType,
eventuallyByteStream: Future[Enumerator[Array[Byte]]],
removeDocsWithOlderTimestamps: Boolean): Future[Int] = ...
private[services] def synchronizeTournaments(
suite: Suite,
dataType: SuiteDataType,
eventuallyByteStream: Future[Enumerator[Array[Byte]]],
removeDocsWithOlderTimestamps: Boolean): Future[Int] = ...
}
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
class SynchronizationService {
private def synchronizeGolf[T, S](suite: Suite,
dataType: SuiteDataType,
eventuallyByteStream: Future[Enumerator[Array[Byte]]],
toIndexDocuments: (Suite, Issuer, GolfClub) => Seq[T] => Iterable[S], // function!
indexDocuments: Iterable[S] => Future[Boolean], // function!
countDocuments: CountRequest => Future[Long], // function!
verify: (Int, Long) => Unit, // function!
removeDocsWithOlderTimestamps: Boolean)(implicit format: Format[T]): Future[Int] = ...
}
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning #4
Don't use every feature as a
hammer
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
for comprehension
val bobUser: Option[User] = ...
val carlUser: Option[User] = ...
val bobCarlAge: Option[Int] =
for {
bob <- bobUser
carl <- carlUser
} yield bob.age + carl.age
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
for comprehension from hell
for {
stopWatch <- Future.successful(startedStopWatch)
startTimestampOfSync = DateTime.now()
byteStream <- eventuallyByteStream
suiteDocStream = toDocumentStream[T](byteStream)
chunkedStream = suiteDocStream &> ExtraEnumeratees.chunker(ChunkSize)
indexerSuccessStream = chunkedStream &> indexer
indexerSuccess <- indexerSuccessStream.run(Iteratee.fold(true)(_ && _))
_ <- if (removedDocsWithOlderTimestamps)
waitForElasticSearchToFinishIndexing().map(_ => removeDocsUpsertedBefore(issuer, dataType, startTimestampOfSync))
else
Future.successful(())
count <- waitForElasticSearchToFinishIndexing().flatMap { _ =>
verifyCount(issuer, counter.get(), countDocuments, verify)
}
} yield {
if (!indexerSuccess) error(s"Failed to index $dataType for ${suite.url}")
val duration = scala.concurrent.duration.Duration(stopWatch.getNanoTime, TimeUnit.NANOSECONDS).toSeconds
info(s"Done synchronizing ${counter.get()} $dataType for ${suite.url}, it took $duration s")
count
}
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Learning #5
Transitioning to Scala
(for teams)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Don't start a Scala project
with a team comprised
of novice and advanced beginners
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Don't start a <XYZ> project
with a team comprised
of novice and advanced beginners
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
It's all about people
The biggest challenges of transitioning to Scala — or anything new 
— are rarely technical. Talented programmers can learn a new
syntax, new concepts, and a new IDE. Rather, change often
brings out the weaknesses in other areas like process and
culture. 6
— Kevin Webber
6
https://medium.com/@kvnwbbr/transitioning-to-scala-d1818f25b2b7#.x1tcfcs58
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Building up Scala knowledge in
your team
• culture that emphasizes learning, create time for learning
• code reviews, discussions
• try to get one "Competent" on your team
• even if it's a "hired gun" helping to bootstrap & ensure
best practices (& avoiding pitfalls)
• invest in training (Fast track to Scala, etc.)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Conclusion
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Conclusion
case class User(name: String, surname: String, age: Int)
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Conclusion
case class User(name: String, surname: String, age: Int)
embrace Scala's terseness
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Conclusion
case class User(name: String, surname: String, age: Int)
embrace Scala's terseness
don't forget about the language levels
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
Thank you!
Questions & Comments ?
• http://manuel.bernhardt.io
• @elmanu
Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu

Contenu connexe

En vedette

Scala Past, Present & Future
Scala Past, Present & FutureScala Past, Present & Future
Scala Past, Present & Futuremircodotta
 
Java 8 and beyond, a scala story
Java 8 and beyond, a scala storyJava 8 and beyond, a scala story
Java 8 and beyond, a scala storyittaiz
 
Practical Aggregate Programming in Scala
Practical Aggregate Programming in ScalaPractical Aggregate Programming in Scala
Practical Aggregate Programming in ScalaRoberto Casadei
 
Reactive Access to MongoDB from Scala
Reactive Access to MongoDB from ScalaReactive Access to MongoDB from Scala
Reactive Access to MongoDB from ScalaHermann Hueck
 
Brendan O'Bra Scala By the Schuykill
Brendan O'Bra Scala By the SchuykillBrendan O'Bra Scala By the Schuykill
Brendan O'Bra Scala By the SchuykillBrendan O'Bra
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Chris Richardson
 
BDX 2016 - Tzach zohar @ kenshoo
BDX 2016 - Tzach zohar  @ kenshooBDX 2016 - Tzach zohar  @ kenshoo
BDX 2016 - Tzach zohar @ kenshooIdo Shilon
 
Macro in Scala
Macro in ScalaMacro in Scala
Macro in Scalatakezoe
 
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)Eugene Yokota
 

En vedette (13)

Scala Past, Present & Future
Scala Past, Present & FutureScala Past, Present & Future
Scala Past, Present & Future
 
Semana12 oct31 nov2
Semana12 oct31 nov2Semana12 oct31 nov2
Semana12 oct31 nov2
 
Web without framework
Web without frameworkWeb without framework
Web without framework
 
Java 8 and beyond, a scala story
Java 8 and beyond, a scala storyJava 8 and beyond, a scala story
Java 8 and beyond, a scala story
 
Practical Aggregate Programming in Scala
Practical Aggregate Programming in ScalaPractical Aggregate Programming in Scala
Practical Aggregate Programming in Scala
 
Scala in Practice
Scala in PracticeScala in Practice
Scala in Practice
 
Reactive Access to MongoDB from Scala
Reactive Access to MongoDB from ScalaReactive Access to MongoDB from Scala
Reactive Access to MongoDB from Scala
 
Brendan O'Bra Scala By the Schuykill
Brendan O'Bra Scala By the SchuykillBrendan O'Bra Scala By the Schuykill
Brendan O'Bra Scala By the Schuykill
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)
 
Fun[ctional] spark with scala
Fun[ctional] spark with scalaFun[ctional] spark with scala
Fun[ctional] spark with scala
 
BDX 2016 - Tzach zohar @ kenshoo
BDX 2016 - Tzach zohar  @ kenshooBDX 2016 - Tzach zohar  @ kenshoo
BDX 2016 - Tzach zohar @ kenshoo
 
Macro in Scala
Macro in ScalaMacro in Scala
Macro in Scala
 
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)
 

Similaire à Six years of Scala and counting

Sakai newcomer 10 easy questions not so easy
Sakai newcomer   10 easy questions not so easySakai newcomer   10 easy questions not so easy
Sakai newcomer 10 easy questions not so easydaniel.merino
 
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Codemotion
 
Scala eXchange 2013 Report
Scala eXchange 2013 ReportScala eXchange 2013 Report
Scala eXchange 2013 ReportMichal Bigos
 
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...OW2
 
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Codemotion
 
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...soapconf
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.brandongulla
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumNgoc Dao
 
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcutUpgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcutChristian Heilmann
 
Alternatives to SQL - a Laravel Perspective
Alternatives to SQL - a Laravel PerspectiveAlternatives to SQL - a Laravel Perspective
Alternatives to SQL - a Laravel PerspectivePeter Coles
 
Introducing Scala in your existing Java project
Introducing Scala in your existing Java projectIntroducing Scala in your existing Java project
Introducing Scala in your existing Java projectING-IT
 
Making ES6 available to all with ChakraCore and Typescript
Making ES6 available to all with ChakraCore and TypescriptMaking ES6 available to all with ChakraCore and Typescript
Making ES6 available to all with ChakraCore and TypescriptChristian Heilmann
 
SiriusCon2016 - Let's talk about your future sirius project
SiriusCon2016 - Let's talk about your future sirius projectSiriusCon2016 - Let's talk about your future sirius project
SiriusCon2016 - Let's talk about your future sirius projectglefur
 
Code Europe Spring 2018 - Mind the Gap
Code Europe Spring 2018 -  Mind the GapCode Europe Spring 2018 -  Mind the Gap
Code Europe Spring 2018 - Mind the GapRichard Abbuhl
 
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...Richard Abbuhl
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scalafanf42
 
Hadoopsummit16 myui
Hadoopsummit16 myuiHadoopsummit16 myui
Hadoopsummit16 myuiMakoto Yui
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mixStefano Galarraga
 
Functional programming in scala coursera
Functional programming in scala  courseraFunctional programming in scala  coursera
Functional programming in scala courseraKetan Raval
 

Similaire à Six years of Scala and counting (20)

Sakai newcomer 10 easy questions not so easy
Sakai newcomer   10 easy questions not so easySakai newcomer   10 easy questions not so easy
Sakai newcomer 10 easy questions not so easy
 
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
 
Scala eXchange 2013 Report
Scala eXchange 2013 ReportScala eXchange 2013 Report
Scala eXchange 2013 Report
 
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...
Guidance, Code and Education: ScalaCenter and the Scala Community, Heather Mi...
 
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
Sviluppare applicazioni nell'era dei "Big Data" con Scala e Spark - Mario Car...
 
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
Felix Sasaki - Value beyond content creation - Introducing ITS 2.0; soapconf ...
 
Scala for n00bs by a n00b.
Scala for n00bs by a n00b.Scala for n00bs by a n00b.
Scala for n00bs by a n00b.
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcutUpgrading JavaScript to ES6 and using TypeScript as a shortcut
Upgrading JavaScript to ES6 and using TypeScript as a shortcut
 
Alternatives to SQL - a Laravel Perspective
Alternatives to SQL - a Laravel PerspectiveAlternatives to SQL - a Laravel Perspective
Alternatives to SQL - a Laravel Perspective
 
Introducing Scala in your existing Java project
Introducing Scala in your existing Java projectIntroducing Scala in your existing Java project
Introducing Scala in your existing Java project
 
Making ES6 available to all with ChakraCore and Typescript
Making ES6 available to all with ChakraCore and TypescriptMaking ES6 available to all with ChakraCore and Typescript
Making ES6 available to all with ChakraCore and Typescript
 
SiriusCon2016 - Let's talk about your future sirius project
SiriusCon2016 - Let's talk about your future sirius projectSiriusCon2016 - Let's talk about your future sirius project
SiriusCon2016 - Let's talk about your future sirius project
 
Code Europe Spring 2018 - Mind the Gap
Code Europe Spring 2018 -  Mind the GapCode Europe Spring 2018 -  Mind the Gap
Code Europe Spring 2018 - Mind the Gap
 
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...
Java With The Best Online Conference - Mind the gap: Java, Machine Learning, ...
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Hadoopsummit16 myui
Hadoopsummit16 myuiHadoopsummit16 myui
Hadoopsummit16 myui
 
From java to scala at crowd mix
From java to scala at crowd mixFrom java to scala at crowd mix
From java to scala at crowd mix
 
Functional programming in scala coursera
Functional programming in scala  courseraFunctional programming in scala  coursera
Functional programming in scala coursera
 

Plus de Manuel Bernhardt

Is there anybody out there? Reactive Systems Hamburg
Is there anybody out there? Reactive Systems HamburgIs there anybody out there? Reactive Systems Hamburg
Is there anybody out there? Reactive Systems HamburgManuel Bernhardt
 
Is there anybody out there? Scala Days Berlin 2018
Is there anybody out there? Scala Days Berlin 2018Is there anybody out there? Scala Days Berlin 2018
Is there anybody out there? Scala Days Berlin 2018Manuel Bernhardt
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?Manuel Bernhardt
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?Manuel Bernhardt
 
3 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 20153 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 2015Manuel Bernhardt
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysManuel Bernhardt
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMManuel Bernhardt
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationManuel Bernhardt
 
Project Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsProject Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsManuel Bernhardt
 
Tips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectTips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectManuel Bernhardt
 

Plus de Manuel Bernhardt (14)

Is there anybody out there? Reactive Systems Hamburg
Is there anybody out there? Reactive Systems HamburgIs there anybody out there? Reactive Systems Hamburg
Is there anybody out there? Reactive Systems Hamburg
 
Is there anybody out there? Scala Days Berlin 2018
Is there anybody out there? Scala Days Berlin 2018Is there anybody out there? Scala Days Berlin 2018
Is there anybody out there? Scala Days Berlin 2018
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?
 
Is there anybody out there?
Is there anybody out there?Is there anybody out there?
Is there anybody out there?
 
3 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 20153 things you must know to think reactive - Geecon Kraków 2015
3 things you must know to think reactive - Geecon Kraków 2015
 
Reactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDaysReactive Web-Applications @ LambdaDays
Reactive Web-Applications @ LambdaDays
 
Writing a technical book
Writing a technical bookWriting a technical book
Writing a technical book
 
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMVoxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migration
 
Project Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 monthsProject Phoenix - From PHP to the Play Framework in 3 months
Project Phoenix - From PHP to the Play Framework in 3 months
 
Scala - Java2Days Sofia
Scala - Java2Days SofiaScala - Java2Days Sofia
Scala - Java2Days Sofia
 
Tips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 projectTips and tricks for setting up a Play 2 project
Tips and tricks for setting up a Play 2 project
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Scala pitfalls
Scala pitfallsScala pitfalls
Scala pitfalls
 

Dernier

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Dernier (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Six years of Scala and counting

  • 1. 7 years of Scala and counting Scala Days Vienna 2017 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 2. 6 years of Scala and counting Scala Vienna User Group May 2016 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 3. Agenda 1. Quick introduction to Scala 2. Learning Scala 3. Using Scala 4. Learnings, reflection, observations, impressions 5. Questions Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 4. Manuel Bernhardt • I help companies getting started with using reactive applications in their distributed systems infrastructure • http://manuel.bernhardt.io Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 5. Manuel Bernhardt • I help companies getting started with using reactive applications in their distributed systems infrastructure • http://manuel.bernhardt.io Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 6. Scala: an introduction Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 7. Scala introduction • first version released in 2003 • Martin Oderksy, EPFL • an estimated more than half a million Scala developers 1 1 http://www.scala-lang.org/blog/2016/03/14/announcing-the-scala- center.html Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 8. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 9. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 10. Scala Center • non-for-profit foundation for Scala education and community guidance • established at EPFL • founding members: IBM, verizon, Goldman Sachs, nitro, Lightbend Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 11. Favourite Feature tour Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 12. case classes public class User { private final String name; private final String surname; private final Integer age; public User(String name, String surname, Integer age) { this.name = name; this.surname = surname; this.age = age; } public String getName() { return this.name; } public String getSurname() { return this.surname; } public String getAge() { return this.age; } @Override public int hashCode() { // ... } @Override public boolean equals(Object that) { // ... } } Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 13. case classes case class User(name: String, surname: String, age: Int) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 14. case classes case class User(name: String, surname: String, age: Int) val bob = User("Bob", "Marley", 42) val namedBob = User(name = "Bob", surname = "Marley", age = 22) val john = bob.copy(name = "John") Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 15. case class • perfect example of the terseness Scala provides • hashcode, equals, toString for free • serializable by default Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 16. type inference val foo = "Bar" // foo: String = Bar val answer = 42 // answer: Int = 42 val price = 9.99 // price: Double = 9.99 val nums = List(1, 2, 3) // nums: List[Int] = List(1, 2, 3) val map = Map("abc" -> List(1, 2, 3)) // map: scala.collection.immutable.Map[String,List[Int]] = Map(abc -> List(1, 2, 3)) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 17. functions and higher-order functions def isMajor(user: User): Boolean = user.age > 18 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 18. functions and higher-order functions def isMajor(user: User): Boolean = user.age > 18 class UserGroup { def filter(predicate: User Boolean): List[User] = ... } Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 19. functions and higher-order functions def isMajor(user: User): Boolean = user.age > 18 class UserGroup { def filter(predicate: User Boolean): List[User] = ... } userGroup.filter(isMajor) // returns only majors Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 20. Learning Scala Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 21. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 22. How "learnable" is Scala? • Shadaj Laddad • http://shadaj.me • learned Scala at age 11-12 • talks at Scala Days, OSCON since 2012 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 23. How "learnable" is Scala? • Coursera courses, 400.000+ participants - highest completation rate in the industry (10%, which is high for a MOOC 2 ) • Scala as beginner programming language at Lund University of Technology 3 3 https://www.lth.se/english/about-lth/news/news/article/scala-will-be-the- beginner-programming-language-of/ 2 Massive Open Online Course Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 24. My learning path • 2010: started dabbling with Scala (books, using it in tests, small projects) • 2011: discovering Functional Programming through Javascript. Using Play Framework 1 with the Scala module in my 2nd startup • 2012: first large codebase to migration from Play 1 to Play 2.0.0 (based entirely on Scala) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 25. My learning path • 2013: several client projects using Scala • 2014-2016: architecture, prototyping, design, implementation, review of various production systems with Scala, Akka, Play Framework; writing Reactive Web Applications Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 26. My learning path • estimated 6 months to "click" • imperative declarative • mutable, global state immutable, expression-oriented • longer to grasp or use more advanced concepts • and how not to shoot myself in the foot with them Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 27. Your learning path? • new Coursera courses by the Scala Center • https://scala.epfl.ch • try to use Scala for something "real" • and even if it is just tests in a real project Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 28. Using Scala Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 29. 6 years without one of those pesky NullPointerException-s Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 30. Significantly less problems at runtime • Scala compiler spots a whole plethora of problems at compile- time • leveraged by e.g. Play Framework, high emphasis on "compiling everything" • URLs • Javascript (Google Clojure Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 31. Less code yields higher maintainbility (Less is more) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 32. IDE / Editors • IntelliJ IDEA • Scala IDE for Eclipse • ENSIME 5 • emacs, Atom, Sublime Text, vim 5 Enhanced Scala and java Interaction Mode for text Editors Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 33. Compiler • slower than the Java compiler • but not a problem (anymore) on modern hardware • especially with incremental compilation • unless you deep dive into type-level and generic programming (e.g. shapeless library) • much more precise than the Java compiler (type-safe ++) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 34. Jobs & Developers Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 36. What I've learned Reflection, Impressions, (Advice) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 37. The Dreyfus model of skill acquisition Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 38. Learning #1 Spend a little time understanding the language design Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 39. Understand Scala's essence and your life will be easier Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 40. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 41. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 42. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 43. Learning #2 Understand the purpose of the language features Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 44. Scala has quite a few language features because it was designed to be extensible Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 45. Don't be that kid Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 46. Scala language levels 4 • Level A1: Beginning application programmer • Level A2: Intermediate application programmer • Level A3: Expert application programmer 4 http://www.scala-lang.org/old/node/8610 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 47. Scala language levels 4 • Level L1: Junior library designer • Level L2: Senior library designer • Level L3: Expert library designer 4 http://www.scala-lang.org/old/node/8610 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 48. The features you need to build applications are not the same as the ones you need to build librariesScala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 49. SIP 18: Modularizing language features import scala.language.implicitConversions import scala.language.dynamics import scala.language.postfixOps import scala.language.reflectiveCalls import scala.language.higherKinds import scala.language.existentials import scala.language.macros Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 50. Incidental complexity Is this really a problem specific to Scala? Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 51. @SuppressWarnings({"unchecked", "rawtypes"}) @Deprecated @OneToMany(@HowManyDBADoYouNeedToChangeALightBulb) @OneToManyMore @AnyOne @AnyBody @YouDoNotTalkAboutOneToMany // Fightclub, LOL @TweakThisWithThat( tweak = { @TweakID(name = "id", preferredValue = 1839), @TweakID(name = "test", preferredValue = 839), @TweakID(name = "test.old", preferredValue = 34), }, inCaseOf = { @ConditionalXMLFiltering(run = 5), } ) @ManyToMany @Many @AnnotationsTotallyRock @DeclarativeProgrammingRules @NoMoreExplicitAlgorithms @Fetch @FetchMany @FetchWithDiscriminator(name = "no_name") @SeveralAndThenNothing @MaybeThisDoesSomething @JoinTable(joinColumns = { @JoinColumn(name = "customer_id", referencedColumnName = "id") }) @DoesThisEvenMeanAnything @DoesAnyoneEvenReadThis @PrefetchJoinWithDiscriminator @JustTrollingYouKnow @LOL @IfJoiningAvoidHashJoins @ButUseHashJoinsWhenMoreThan(records = 1000) @XmlDataTransformable @SpringPrefechAdapter private Collection employees; // http://annotatiomania.com Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 52. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 53. Learning #3 Don't forget all about Object Oriented Programming Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 54. class SynchronizationService { private[services] def synchronizeTeeTimes( suite: Suite, dataType: SuiteDataType, eventuallyByteStream: Future[Enumerator[Array[Byte]]], removeDocsWithOlderTimestamps: Boolean): Future[Int] = ... private[services] def synchronizeTournaments( suite: Suite, dataType: SuiteDataType, eventuallyByteStream: Future[Enumerator[Array[Byte]]], removeDocsWithOlderTimestamps: Boolean): Future[Int] = ... } Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 55. class SynchronizationService { private def synchronizeGolf[T, S](suite: Suite, dataType: SuiteDataType, eventuallyByteStream: Future[Enumerator[Array[Byte]]], toIndexDocuments: (Suite, Issuer, GolfClub) => Seq[T] => Iterable[S], // function! indexDocuments: Iterable[S] => Future[Boolean], // function! countDocuments: CountRequest => Future[Long], // function! verify: (Int, Long) => Unit, // function! removeDocsWithOlderTimestamps: Boolean)(implicit format: Format[T]): Future[Int] = ... } Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 56. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 57. Learning #4 Don't use every feature as a hammer Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 58. for comprehension val bobUser: Option[User] = ... val carlUser: Option[User] = ... val bobCarlAge: Option[Int] = for { bob <- bobUser carl <- carlUser } yield bob.age + carl.age Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 59. for comprehension from hell for { stopWatch <- Future.successful(startedStopWatch) startTimestampOfSync = DateTime.now() byteStream <- eventuallyByteStream suiteDocStream = toDocumentStream[T](byteStream) chunkedStream = suiteDocStream &> ExtraEnumeratees.chunker(ChunkSize) indexerSuccessStream = chunkedStream &> indexer indexerSuccess <- indexerSuccessStream.run(Iteratee.fold(true)(_ && _)) _ <- if (removedDocsWithOlderTimestamps) waitForElasticSearchToFinishIndexing().map(_ => removeDocsUpsertedBefore(issuer, dataType, startTimestampOfSync)) else Future.successful(()) count <- waitForElasticSearchToFinishIndexing().flatMap { _ => verifyCount(issuer, counter.get(), countDocuments, verify) } } yield { if (!indexerSuccess) error(s"Failed to index $dataType for ${suite.url}") val duration = scala.concurrent.duration.Duration(stopWatch.getNanoTime, TimeUnit.NANOSECONDS).toSeconds info(s"Done synchronizing ${counter.get()} $dataType for ${suite.url}, it took $duration s") count } Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 60. Learning #5 Transitioning to Scala (for teams) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 61. Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 62. Don't start a Scala project with a team comprised of novice and advanced beginners Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 63. Don't start a <XYZ> project with a team comprised of novice and advanced beginners Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 64. It's all about people The biggest challenges of transitioning to Scala — or anything new  — are rarely technical. Talented programmers can learn a new syntax, new concepts, and a new IDE. Rather, change often brings out the weaknesses in other areas like process and culture. 6 — Kevin Webber 6 https://medium.com/@kvnwbbr/transitioning-to-scala-d1818f25b2b7#.x1tcfcs58 Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 65. Building up Scala knowledge in your team • culture that emphasizes learning, create time for learning • code reviews, discussions • try to get one "Competent" on your team • even if it's a "hired gun" helping to bootstrap & ensure best practices (& avoiding pitfalls) • invest in training (Fast track to Scala, etc.) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 66. Conclusion Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 67. Conclusion case class User(name: String, surname: String, age: Int) Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 68. Conclusion case class User(name: String, surname: String, age: Int) embrace Scala's terseness Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 69. Conclusion case class User(name: String, surname: String, age: Int) embrace Scala's terseness don't forget about the language levels Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu
  • 70. Thank you! Questions & Comments ? • http://manuel.bernhardt.io • @elmanu Scala Vienna May 2016 - manuel.bernhardt.io - @elmanu