1 of 7

Scala: Beyond the Basics

Expanding your Java mind

2 of 7

Why should you consider Scala?

  • Readability
    • Verbosity vs Flexibility
  • Otherness
    • Scala is Different and that’s good
    • More difficult to learn? Yes and No
    • Comparison with Kotlin, Groovy, Ceylon, Clojure, etc.
    • No null
    • Default args, named args, case classes, and so much more
  • DSL
    • Spaces vs Dots
    • Matching
    • Regular Expressions
    • Apply Method
    • Unapply Method
    • Operators
  • Performance
    • Lazy
    • String interpolation
    • Tail recursion
    • Macros

3 of 7

Companies Using Scala

  • Apple
  • Federal Government
  • Foursquare
  • LinkedIn
  • Twitter
  • Netflix
  • Angie’s List
  • Sony
  • The Weather Channel
  • eBay
  • AT&T
  • Tumblr
  • Amazon
  • IBM
  • Nasa
  • Novell
  • Bank of America
  • Google
  • Many many more...

4 of 7

Coding Exercises (Part 1)

  • Concepts
    • Wildcard (Import, Default, Ignore)
    • Option
    • Either
    • Lazy
    • Apply method
    • Triple-Quote
    • String Interpolation
    • Loops
      • For
      • For Each
      • Recursion
    • Right-Associative Infix Operators (ex. ::)
    • Currying

5 of 7

Coding Exercises (Part 2)

  • Case Classes
    • Copy
    • Equality, toString, hashCode, apply, vals, tupled, unapply
    • Default Args and Named Args
  • Traits
    • Basics
    • Priority
    • Abstract Override
  • Matching
    • Option
    • Casting
    • Unapply
    • Regular Expressions
  • Functions
    • Composition
    • Extending

6 of 7

Coding Exercises (Part 3)

  • Collections
    • Mutable / Immutable
    • List / Vector / Array / Seq / Set / Map
    • flatten, map, flatMap, filter, collect, foldLeft
    • Views and Streams
  • Tuples
  • Asynchronous
    • Futures
    • Promises
  • Macros
    • Basic Concepts
    • A quick look at “buildable”
  • Implicits
    • Conversions
    • Arguments

7 of 7

Coding Exercises (Part 4)

  • Complete Application - NumberGuess
    • SBT project
    • Assembly SBT plugin
    • Load into IntelliJ
    • Check / Save Solution to File
    • Validate input arg
    • Delete Solution if Guess Successful
    • Write Tries to File
  • DSL Fun
    • if (i < 10) "Yes" else "No"
    • (i < 10) ? "Yes" | "No"
  • Java Interoperability
    • @buildable for immutability in Java
    • Static
    • Functions
  • Open Discussion
    • Anything Scala or Java
    • Frameworks
    • Methodology