Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Solid Scala

Solid Scala

Presentation to Semantico, Brighton.

Ff619670d30ebdeefd49cf10af8e3292?s=128

Richard Dallaway

August 23, 2013
Tweet

Transcript

  1. Richard Dallaway @d6y www.underscoreconsulting.com

  2. Agenda 1. Benefits of Scala 2. What it looks like

    3. Why we trust it 4. How to start
  3. Benefits Productivity Maintainability Multi-core Developer Joy

  4. Without giving up... Performance Curly Braces Java Investment Tooling (but...)

  5. import org.joda.time.DateTime case class Subscription( owner: String, isTrial: Boolean, expiry:

    DateTime) val nextMonth = new DateTime().plusMonths(1) val sub = new Subscription( "Bob", isTrial = true, nextMonth) sub.owner // “Bob” sub == new Subscription( "Bob", true, nextMonth) // true
  6. val subs = List( Subscription("Anna", true, new DateTime()), ... )

    val trials : List[Subscription] = subs.filter(s => s.isTrial) def expiring(sub: Subscription) : Boolean = daysBetween(now,sub.expiry).getDays < 2 val nagList = subs.filter(expiring) val expiringTrials = subs.filter(expiring).filter(_.isTrial)
  7. case class Sub(name: String, cc: Option[String]) val subs = List(

    Sub("Anna", None), Sub("Bob", Some("1234-5678-9123-4567")) ) def bill(cc: String) : Result = ... val results = subs.flatMap(s => s.cc).map(bill) val results = for { sub <- subs cc <- sub.cc } yield bill(cc) .par
  8. 2003 2006 2009 2008 2011 2004 2005 2010 2007 2012

    2013 2014 1.0 2.0 2.3 2.8 2.7 2.9 2.10 2.11 2.6 2.5 2.4 2.9.3 2.8.2
  9. The guy who built javac SpringSource VMware An advisor

  10. None
  11. Ideas for starting 1. Small project trial 2. Mixed Java/Scala

    projects 3. For tests
  12. @d6y @davegurnell @milessabin www.underscoreconsulting.com meetup.com/london-scala meetup.com/Functional-Brighton