A sightseeing tour


      Iulian Dogariu
      Ness Technologies
Iași JUG – 13 February 2013
I’m sure I’ve been here before
That’s it! Goodbye



 And thank you for riding with Scala Tours
Who are You?
“If someone had shown me the
Programming in Scala book in 2003, I
would not have created Groovy”

                -- James Strachan, creator of Groovy
C:

“ASM is not portable”
C++:

     “C is nice,
but OOP is the future”
Java:

      “C++ is nice,
but it’s too dangerous”
C#:

    “Java is nice”
“And we’re so jealous!”
Scala?
     “Java is nice”
“And we’re so jealous”
    “… of Haskell”
   “… and Erlang”
   “… and Python”
Functional style
           Express processes, not just things




def listCapitalisedWords(text:String) =
    text.split("s").
      filterNot(_.isEmpty).
      filter(_.charAt(0).isUpper)
Massive concurrency

Message passing


No shared state


Ready for the “multicore era”
But also

Less code => Less room for bugs to hide in (!)


More expressive constraints in the types


Full Java interoperability
Options, options everywhere
“We can do this in Java too”



 It’s not what is possible, it’s what is easy
Pattern matching
Got Change?



val vs var
Traits
λ
What’s the use?



Language is a medium of expression, not just a tool
Data structures
     Choose the right one, and the algorithms take care of themselves

val weekdays = List(“Monday”, “Tuesday”,
                    “Wednesday”, “Thursday”,
                    “Friday”)

val beatles = Set(“Ringo”, “John”,
                  “Paul”, “George”)

val aTuple = (1, “John Smith”, false)

val dataset = Array( (1, “Ion Popescu”),
                     (3, “Maria Teodorescu”) )
Actors
Who uses Scala?




Source: slideshare.net/mslinn/scala-adoption-by-enterprises
How popular?




    …

         Source: TIOBE index February 2013
… hmm.




         Source: TIOBE index February 2013
Tooling
Pitfalls




and oddities
One more thing
specs2
[…] You can write large programs in
JavaScript. You just can’t maintain
them.
                           -- Anders Hejlsberg
Use your head

“Lacking opinions, all code reflects the coder”
Resources
• http://www.scala-lang.org

• Book: Martin Odersky – Programming in Scala

• Book: Venkat Subramaniam – Programming Scala

• Commercial support: Typesafe, Inc.
  http://www.typesafe.com
Thank you!

Scala