SlideShare a Scribd company logo
1 of 35
Introducing Scala to your
     Java/Ruby Shop
      My experiences at IGN



                           Manish Pandit
                   Silicon Valley Code Camp ‘12
                            Oct 7th, 2012
About me

             Manish Pandit
      Director of Engineering, IGN
             @lobster1234

       linkedin.com/in/mpandit
About IGN
We are a leading online media and services
company
obsessed with gaming and entertainment.

56MM Monthly Unique Views
737MM Monthly Page Views
20MM Monthly Video Views
My Objective
Is:
To share my story of introducing Scala to IGN, and
(hopefully) show you the path to enlightenment.


Isn't:
To incite a functional vs. imperative, or Scala vs. ____
debate.
The IGN Tech Stack
Best tool for the job
• Front End : JS, CSS3, HTML5, backbone,
  Coffeescript, jQuery
• Middle Tier : ZF2 (PHP), Rails
• APIs : Scala, some Java
• Persistence : MongoDB, MySQL, Redis
• Search : ElasticSearch
• Caching : Memcached, Varnish
APIs at IGN : Numbers
• ~5 Billion requests a month
• Average Response time of under
  20ms on cache misses
• 17 APIs between Social, OAuth,
  and Content
• Hardest hit APIs doing about
  25K RPM at peak
The Kitchen Sink
• CMS – JSPs talking to Oracle DB and some Java
  services
• V1 API : Java Services using Oracle DB with
  Memcached
• V2 API : Rails based API layer using MongoDB and a
  Java/Memcached front cache
• Lots of duct tape like messaging and cron jobs for
  simple tasks
• Too diverse of a stack in the API infrastructure
The API Evolution : V3 [2012]
• A fresh look at the APIs and IGN’s direction
• First attempt to
  – Integrate all content types
  – Open up the APIs to external consumers
  – Evolve the CMS, traditionally a monolithic system
  – ElasticSearch
  – Varnish Response Caching
• A learning opportunity for traditional Java
  stack engineers
Roadblocks
• Resistance to change
  – Culture
  – Willingness and commitment
• Too many choices – making the right pick
  – Involve every one
  – Do not decide by committee, decide by learning
  – Time box and measure everything
  – Be accountable, as you’re looked upon as the
    expert
The hunt for…
•   A runtime as fast, if not faster than Java
•   Concise, yet expressive
•   Less boilerplate
•   Smooth learning curve and ramp up
•   Re-use ecosystem of libraries
•   Growing adoption and developer velocity
•   Built in support for concurrency
•   Fast and fun development
•   Next level of programming – disrupt!
Why Scala : Strategic Reasons
• Evolve the talent brand along side evolving
  the platform
• Establish an API platform by replacing
  “rewrite” with learning instead of porting
• Start thinking functional
• Align with the leaders in the APIs
• Get involved with a technology as it is evolving
  (vs. established). Helps with influence.
Why Scala : Tactical Reasons
• Performance tied to cores than processor
  speed, i.e. concurrency
• Ideal for API development – (relatively) simple
  to handle concurrency and immutability
• JVM based = Performance
• Re-use Java toolkits and libraries
• Concise, yet expressive code
• Actor model makes the difficult parts easy
Why Scala : Tactical Reasons
•   Richer Collections API
•   Traits enabling Mix-Ins and behavior re-use
•   Statically Typed w/Type inference
•   Functional, but not alien (it can be!)
•   REPL
Yes, Virginia, Scala is hard : DPP
So, how can you figure out if Scala will be "easy" or "hard" for your
organization:
•Your company has speakers at JavaOne, OSCON, Strangle Loop, QCon: Scala
will be easy
•Lunch-time discussions involve the criteria for moving from a developer to a
senior developer: Scala will be hard
•Your developers can write code in NotePad if they have to: Easy
•Your developers stare blankly or say 3 "Hail Marys" when they hear the
name "Zed Shaw": Scala == Hard
•Developers all follow Dean Wampler on Twitter: Scala Easy
•Your developers come in at 9:15 and leave before 6 and don't check work
email at night: Hard

   http://blog.goodstuff.im/yes-virginia-scala-is-hard
Picking up Scala : Week 1
• Scala for Java Developers fast-tracked the
  learning
• Syntax Familiarity
• Java without semicolons?
     def total(nums: List[Int]) :Int = {
       var sum:Int=0
       for(num<-nums) {
         sum+=num
       }
       sum
     }
Picking up Scala : Week 4
• Reduce the lines of code, embrace
  immutability, use the functional paradigms
  built into the language
• Unmystrify the implicits magic
    nums.foldLeft(0)((n,c) => n+c)
Picking up Scala : Today
• Focus on immutability
• Think functional – with the knowledge gained
  from using the functional aspects of the
  language, build control abstractions
• Explore and implement ScalaZ
• Keep learning, and applying
• Move all the Actor processing to Akka
Less Boilerplate
  public class HelloWorld{
     public static void main(String... args){
           System.out.println("Hello, World!");
     }
  }

  object HelloWorld extends App{
     println("Hello, World!")
  }

  scala> println("Hello, World!")
Expressive, yet concise
  val x = if(n%2==0) "Even" else "Odd"

  val x = for(i <- 1 to 10) yield i*2

  val x = for(i <- 1 to 10; if(i%2==0)) yield i*2

  val y = 20 match{
     case p if(p%2==0) => "Even"
     case _ => "Odd"
  }

  val largest = List(1,5,2,6).foldLeft(0)((a,b)=> if(a>b)
  a else b)
Less pain points
  No more dreaded null or throwing unwanted exceptions :
  Use Option[T]

  def thisMayReturnNull[T](x:T):Option[T]={
     if(true) Some(x) else None
  }


  No more creating classes only to return more than 1 value :
  Use Tuples

  def doublePair(x:Int)= (x,x*2)
Try-catch mess
try{
       //Construct a URL which can throw a MalformedURLException
       //do something with a URL which can throw IOException
       //do something with string encoding which can throw
       // UnsupportedEncodingException
 } catch{
   case mal:MalformedURLException => //something
   case ioe: IOException => //something
   case e: Exception => //something
 }
Type Inference
scala> val x = "Sunday"
x: java.lang.String = Sunday

scala> def x(n:Int) = n*3
x: (n: Int)Int

scala> 1 to 5
res2: scala.collection.immutable.Range.Inclusive =
Range(1, 2, 3, 4, 5)

scala> def x = if(true) Left("Yes!") else Right(new
Exception("Didn’t work out!"))
x: Product with Serializable with
Either[java.lang.String,java.lang.Exception]
Dynamic Mix-ins
class Home(bedrooms:Int=3,bathrooms:Double=2.5)

trait Garage{
  def park(n:Int) = println("Parking " + n + "cars")
}

val someHome = new Home

val someHomeWithGarage = new Home with Garage

someHomeWithGarage.park(2)
Concurrency
• Actors make concurrency so much easier
  – Messaging vs. Blocking
  – Lightweight, 300-500 bytes per instance
  – Isolated
Scala API Components
•   Scalatra
•   Lift-MongoRecord for MongoDB
•   Casbah for MongoDB
•   PlayFramework 2
•   Actors for tasks like syndication
•   sbt and Maven for Builds
•   MongoDB for persistence
Other API Components
•   Varnish Cache
•   Elasticsearch
•   Yammer Metrics (ping, healthcheck)
•   Swagger (self-documenting RESTful APIs)
•   3Scale for Partner APIs
•   IntelliJ IDEA and Eclipse with ScalaIDE
•   PlayFramework 2.0 (New!)
•   ScalaTest for Testing
Challenges with Scala                             *


• Steepness of the Learning curve depends
  entirely on your org culture
• Scala is what you make of it
   • http://scalaz.github.com/scalaz/scalaz-2.9.1-
     6.0.4/doc.sxr/scalaz/BKTree.scala.html

   • Middle Ground between Simplicity and,
     well..elegance



* None of these challenges outweigh the benefits. They’re just something to
be aware of.
Challenges with Scala
• Slow compilation based on the source
• No (binary) compatibility of dependencies for
  the major releases (2.8, 2.9, 2.10(?))
• Tooling not as rich as Java
  – Changing (rapidly) with Typesafe investing in
    ScalaIDE
  – ScalaIDE comes with a Scala Worksheet, which is
    like REPL but richer
Lessons Learned : Culture
• Culture of Meetups, Hack
  Nights and Code Jams
• Being able to connect with
  the contributors and
  language creators
• Willingness to invest in
  learning, evolving vs.
  maintaining
Lessons Learned : Team
•   Small team (~5 engineers)
•   Java background helped a lot
•   10% time set aside for skill building
•   Learn and share
•   It is a commitment
•   Communication!
Lessons Learned : Material
• Books that have exercises, so you
  can quantify your learning.
• Online tutorials
• StackOverflow
• Coursera : A course on Functional
  Programming by Martin Odersky
Resources
• Books
   – Programming in Scala by Odersky
   – Scala for the Impatient by Horstmann
• Interwebz
   – http://debasishg.blogspot.com
   – http://www.reddit.com/r/scala
   – http://stackoverflow.com/tags/scala/info
   – http://twitter.github.com/scala_school
   – https://www.coursera.org/course/progfun
scala> case class Me(name:String="Manish
Pandit",twitter:String="@lobster1234")
defined class Me

scala> val me = new Me
me: Me = Me(Manish Pandit,@lobster1234)

scala> println(“Questions!”)
Questions!

More Related Content

What's hot

Scala for android
Scala for androidScala for android
Scala for androidTack Mobile
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaDerek Chen-Becker
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and BackAnil Hemrajani
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updatesVinay H G
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling SoftwareAbdelmonaim Remani
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with javaHawkman Academy
 
Java unit1 a- History of Java to string
Java unit1 a- History of Java to stringJava unit1 a- History of Java to string
Java unit1 a- History of Java to stringSivaSankari36
 
Scala's evolving ecosystem- Introduction to Scala.js
Scala's evolving ecosystem- Introduction to Scala.jsScala's evolving ecosystem- Introduction to Scala.js
Scala's evolving ecosystem- Introduction to Scala.jsKnoldus Inc.
 
PROGRAMMING IN JAVA- unit 4-part II
PROGRAMMING IN JAVA- unit 4-part IIPROGRAMMING IN JAVA- unit 4-part II
PROGRAMMING IN JAVA- unit 4-part IISivaSankari36
 
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
 
Java 101 Intro to Java Programming
Java 101 Intro to Java ProgrammingJava 101 Intro to Java Programming
Java 101 Intro to Java Programmingagorolabs
 
Java basics at Lara Technologies
Java basics at Lara TechnologiesJava basics at Lara Technologies
Java basics at Lara Technologieslaratechnologies
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)lazyatom
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6Rob Eisenberg
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin ProgrammingAtlassian
 
JScala. Write your JavaScript in Scala
JScala. Write your JavaScript in ScalaJScala. Write your JavaScript in Scala
JScala. Write your JavaScript in ScalaAlexander Nemish
 
PROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part IIPROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part IISivaSankari36
 

What's hot (20)

Scala for android
Scala for androidScala for android
Scala for android
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
Java 101 intro to programming with java
Java 101  intro to programming with javaJava 101  intro to programming with java
Java 101 intro to programming with java
 
Java unit1 a- History of Java to string
Java unit1 a- History of Java to stringJava unit1 a- History of Java to string
Java unit1 a- History of Java to string
 
Scala's evolving ecosystem- Introduction to Scala.js
Scala's evolving ecosystem- Introduction to Scala.jsScala's evolving ecosystem- Introduction to Scala.js
Scala's evolving ecosystem- Introduction to Scala.js
 
PROGRAMMING IN JAVA- unit 4-part II
PROGRAMMING IN JAVA- unit 4-part IIPROGRAMMING IN JAVA- unit 4-part II
PROGRAMMING IN JAVA- unit 4-part II
 
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
 
Java 101 Intro to Java Programming
Java 101 Intro to Java ProgrammingJava 101 Intro to Java Programming
Java 101 Intro to Java Programming
 
Java basics at Lara Technologies
Java basics at Lara TechnologiesJava basics at Lara Technologies
Java basics at Lara Technologies
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)The Dark Art of Rails Plugins (2008)
The Dark Art of Rails Plugins (2008)
 
The New JavaScript: ES6
The New JavaScript: ES6The New JavaScript: ES6
The New JavaScript: ES6
 
Polyglot Plugin Programming
Polyglot Plugin ProgrammingPolyglot Plugin Programming
Polyglot Plugin Programming
 
JScala. Write your JavaScript in Scala
JScala. Write your JavaScript in ScalaJScala. Write your JavaScript in Scala
JScala. Write your JavaScript in Scala
 
PROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part IIPROGRAMMING IN JAVA- unit 5-part II
PROGRAMMING IN JAVA- unit 5-part II
 
Scala: An OO Surprise
Scala: An OO SurpriseScala: An OO Surprise
Scala: An OO Surprise
 

Viewers also liked

πώςθα δημιουργήσετε ένα σενάριο διδασκαλίας
πώςθα δημιουργήσετε ένα  σενάριο διδασκαλίαςπώςθα δημιουργήσετε ένα  σενάριο διδασκαλίας
πώςθα δημιουργήσετε ένα σενάριο διδασκαλίαςChristos Gotzaridis
 
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειου
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειουΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειου
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειουChristos Gotzaridis
 
Political Cartoons
Political CartoonsPolitical Cartoons
Political CartoonsAmy
 
Katechismus 11 - 12 jarigen - De Tien Geboden
Katechismus 11 - 12 jarigen - De Tien GebodenKatechismus 11 - 12 jarigen - De Tien Geboden
Katechismus 11 - 12 jarigen - De Tien GebodenN Couperus
 
Onlinetools&amp;Job Search2010
Onlinetools&amp;Job Search2010Onlinetools&amp;Job Search2010
Onlinetools&amp;Job Search2010Cindy Edwards
 
Programming Ruby On Rails
Programming Ruby On RailsProgramming Ruby On Rails
Programming Ruby On RailsEiji Sakai
 
Knowwi Intro 2010
Knowwi Intro 2010Knowwi Intro 2010
Knowwi Intro 2010marklaszlo
 
Katechismus 11 - 12 jarigen - De Geloofsbelijdenis
Katechismus 11 - 12 jarigen - De GeloofsbelijdenisKatechismus 11 - 12 jarigen - De Geloofsbelijdenis
Katechismus 11 - 12 jarigen - De GeloofsbelijdenisN Couperus
 
Pp Kee Dome Web
Pp Kee Dome WebPp Kee Dome Web
Pp Kee Dome WebKee Safety
 
Future Agenda Future Of Energy
Future Agenda   Future Of EnergyFuture Agenda   Future Of Energy
Future Agenda Future Of EnergyFuture Agenda
 
Evolving IGN’s New APIs with Scala
 Evolving IGN’s New APIs with Scala Evolving IGN’s New APIs with Scala
Evolving IGN’s New APIs with ScalaManish Pandit
 
Research writing introduction
Research writing  introductionResearch writing  introduction
Research writing introductionAngelina Merritt
 
Makeup Consultations & Professional Makeup: A Beautiful Education
Makeup Consultations & Professional Makeup: A Beautiful EducationMakeup Consultations & Professional Makeup: A Beautiful Education
Makeup Consultations & Professional Makeup: A Beautiful EducationLillybeth: A Beautiful Education
 
Danish mediaassoc conf 2014 (condenast)
Danish mediaassoc conf 2014 (condenast)Danish mediaassoc conf 2014 (condenast)
Danish mediaassoc conf 2014 (condenast)Rick (Richard) Welch
 
ThirdSpace: orchestrating collaborative activities in PLEs for formal learning
ThirdSpace: orchestrating collaborative activities in PLEs for formal learningThirdSpace: orchestrating collaborative activities in PLEs for formal learning
ThirdSpace: orchestrating collaborative activities in PLEs for formal learningYvan Peter
 

Viewers also liked (20)

Acacia Research and Learning Forum Tutorial 2
Acacia Research and Learning Forum Tutorial 2Acacia Research and Learning Forum Tutorial 2
Acacia Research and Learning Forum Tutorial 2
 
πώςθα δημιουργήσετε ένα σενάριο διδασκαλίας
πώςθα δημιουργήσετε ένα  σενάριο διδασκαλίαςπώςθα δημιουργήσετε ένα  σενάριο διδασκαλίας
πώςθα δημιουργήσετε ένα σενάριο διδασκαλίας
 
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειου
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειουΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειου
ΦΕΚ ΔΙΔΑΣΚΑΛΙΑΣ ΤΗΣ ΦΥΣΙΚΗΣ Α ΛΥΚΕΙΟΥ 2011-12 διδασκαλιασ τησ φυσικησ α λυκειου
 
Political Cartoons
Political CartoonsPolitical Cartoons
Political Cartoons
 
LSAS mokymai
LSAS mokymaiLSAS mokymai
LSAS mokymai
 
Katechismus 11 - 12 jarigen - De Tien Geboden
Katechismus 11 - 12 jarigen - De Tien GebodenKatechismus 11 - 12 jarigen - De Tien Geboden
Katechismus 11 - 12 jarigen - De Tien Geboden
 
Onlinetools&amp;Job Search2010
Onlinetools&amp;Job Search2010Onlinetools&amp;Job Search2010
Onlinetools&amp;Job Search2010
 
Programming Ruby On Rails
Programming Ruby On RailsProgramming Ruby On Rails
Programming Ruby On Rails
 
Knowwi Intro 2010
Knowwi Intro 2010Knowwi Intro 2010
Knowwi Intro 2010
 
Katechismus 11 - 12 jarigen - De Geloofsbelijdenis
Katechismus 11 - 12 jarigen - De GeloofsbelijdenisKatechismus 11 - 12 jarigen - De Geloofsbelijdenis
Katechismus 11 - 12 jarigen - De Geloofsbelijdenis
 
Research
ResearchResearch
Research
 
Pp Kee Dome Web
Pp Kee Dome WebPp Kee Dome Web
Pp Kee Dome Web
 
Future Agenda Future Of Energy
Future Agenda   Future Of EnergyFuture Agenda   Future Of Energy
Future Agenda Future Of Energy
 
Evolving IGN’s New APIs with Scala
 Evolving IGN’s New APIs with Scala Evolving IGN’s New APIs with Scala
Evolving IGN’s New APIs with Scala
 
Photo Album
Photo AlbumPhoto Album
Photo Album
 
Research writing introduction
Research writing  introductionResearch writing  introduction
Research writing introduction
 
Makeup Consultations & Professional Makeup: A Beautiful Education
Makeup Consultations & Professional Makeup: A Beautiful EducationMakeup Consultations & Professional Makeup: A Beautiful Education
Makeup Consultations & Professional Makeup: A Beautiful Education
 
Danish mediaassoc conf 2014 (condenast)
Danish mediaassoc conf 2014 (condenast)Danish mediaassoc conf 2014 (condenast)
Danish mediaassoc conf 2014 (condenast)
 
ThirdSpace: orchestrating collaborative activities in PLEs for formal learning
ThirdSpace: orchestrating collaborative activities in PLEs for formal learningThirdSpace: orchestrating collaborative activities in PLEs for formal learning
ThirdSpace: orchestrating collaborative activities in PLEs for formal learning
 
1 3
1 31 3
1 3
 

Similar to Introducing Scala to your Ruby/Java Shop : My experiences at IGN

Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinayViplav Jain
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistpmanvi
 
Scala in practice
Scala in practiceScala in practice
Scala in practiceTomer Gabel
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark Summit
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMarakana Inc.
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to ScalaBrent Lemons
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the WildTomer Gabel
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
 
Building DSLs with Scala
Building DSLs with ScalaBuilding DSLs with Scala
Building DSLs with ScalaMohit Jaggi
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsScala Italy
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSAlberto Paro
 
Functional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfFunctional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfssusercd195b
 
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]Leonardo De Moura Rocha Lima
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprisesMike Slinn
 

Similar to Introducing Scala to your Ruby/Java Shop : My experiences at IGN (20)

Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 
Scala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologistScala and jvm_languages_praveen_technologist
Scala and jvm_languages_praveen_technologist
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
Spark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin OderskySpark - The Ultimate Scala Collections by Martin Odersky
Spark - The Ultimate Scala Collections by Martin Odersky
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
An Introduction to Scala
An Introduction to ScalaAn Introduction to Scala
An Introduction to Scala
 
Scala in the Wild
Scala in the WildScala in the Wild
Scala in the Wild
 
Scala Introduction
Scala IntroductionScala Introduction
Scala Introduction
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Building DSLs with Scala
Building DSLs with ScalaBuilding DSLs with Scala
Building DSLs with Scala
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
 
Functional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdfFunctional Scala 2022 - scalajs Alexis.pdf
Functional Scala 2022 - scalajs Alexis.pdf
 
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
JavaOne 2017 - Collections.compare:JDK, Eclipse, Guava, Apache... [CON1754]
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 

More from Manish Pandit

Disaster recovery - What, Why, and How
Disaster recovery - What, Why, and HowDisaster recovery - What, Why, and How
Disaster recovery - What, Why, and HowManish Pandit
 
Serverless Architectures on AWS in practice - OSCON 2018
Serverless Architectures on AWS in practice - OSCON 2018Serverless Architectures on AWS in practice - OSCON 2018
Serverless Architectures on AWS in practice - OSCON 2018Manish Pandit
 
Disaster Recovery and Reliability
Disaster Recovery and ReliabilityDisaster Recovery and Reliability
Disaster Recovery and ReliabilityManish Pandit
 
Immutable AWS Deployments with Packer and Jenkins
Immutable AWS Deployments with Packer and JenkinsImmutable AWS Deployments with Packer and Jenkins
Immutable AWS Deployments with Packer and JenkinsManish Pandit
 
AWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaAWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaManish Pandit
 
AWS Primer and Quickstart
AWS Primer and QuickstartAWS Primer and Quickstart
AWS Primer and QuickstartManish Pandit
 
Securing your APIs with OAuth, OpenID, and OpenID Connect
Securing your APIs with OAuth, OpenID, and OpenID ConnectSecuring your APIs with OAuth, OpenID, and OpenID Connect
Securing your APIs with OAuth, OpenID, and OpenID ConnectManish Pandit
 
Silicon Valley 2014 - API Antipatterns
Silicon Valley 2014 - API AntipatternsSilicon Valley 2014 - API Antipatterns
Silicon Valley 2014 - API AntipatternsManish Pandit
 
Scalabay - API Design Antipatterns
Scalabay - API Design AntipatternsScalabay - API Design Antipatterns
Scalabay - API Design AntipatternsManish Pandit
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixManish Pandit
 
API Design Antipatterns - APICon SF
API Design Antipatterns - APICon SFAPI Design Antipatterns - APICon SF
API Design Antipatterns - APICon SFManish Pandit
 
Motivation : it Matters
Motivation : it MattersMotivation : it Matters
Motivation : it MattersManish Pandit
 
Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Manish Pandit
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingManish Pandit
 
Silicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you RESTSilicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you RESTManish Pandit
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBManish Pandit
 

More from Manish Pandit (20)

Disaster recovery - What, Why, and How
Disaster recovery - What, Why, and HowDisaster recovery - What, Why, and How
Disaster recovery - What, Why, and How
 
Serverless Architectures on AWS in practice - OSCON 2018
Serverless Architectures on AWS in practice - OSCON 2018Serverless Architectures on AWS in practice - OSCON 2018
Serverless Architectures on AWS in practice - OSCON 2018
 
Disaster Recovery and Reliability
Disaster Recovery and ReliabilityDisaster Recovery and Reliability
Disaster Recovery and Reliability
 
OAuth2 primer
OAuth2 primerOAuth2 primer
OAuth2 primer
 
Immutable AWS Deployments with Packer and Jenkins
Immutable AWS Deployments with Packer and JenkinsImmutable AWS Deployments with Packer and Jenkins
Immutable AWS Deployments with Packer and Jenkins
 
AWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaAWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and Java
 
AWS Primer and Quickstart
AWS Primer and QuickstartAWS Primer and Quickstart
AWS Primer and Quickstart
 
Securing your APIs with OAuth, OpenID, and OpenID Connect
Securing your APIs with OAuth, OpenID, and OpenID ConnectSecuring your APIs with OAuth, OpenID, and OpenID Connect
Securing your APIs with OAuth, OpenID, and OpenID Connect
 
Silicon Valley 2014 - API Antipatterns
Silicon Valley 2014 - API AntipatternsSilicon Valley 2014 - API Antipatterns
Silicon Valley 2014 - API Antipatterns
 
Scalabay - API Design Antipatterns
Scalabay - API Design AntipatternsScalabay - API Design Antipatterns
Scalabay - API Design Antipatterns
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
 
API Design Antipatterns - APICon SF
API Design Antipatterns - APICon SFAPI Design Antipatterns - APICon SF
API Design Antipatterns - APICon SF
 
Motivation : it Matters
Motivation : it MattersMotivation : it Matters
Motivation : it Matters
 
Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2
 
Scala at Netflix
Scala at NetflixScala at Netflix
Scala at Netflix
 
IGN's V3 API
IGN's V3 APIIGN's V3 API
IGN's V3 API
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Silicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you RESTSilicon Valley Code Camp 2011: Play! as you REST
Silicon Valley Code Camp 2011: Play! as you REST
 
Silicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDBSilicon Valley Code Camp: 2011 Introduction to MongoDB
Silicon Valley Code Camp: 2011 Introduction to MongoDB
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Introducing Scala to your Ruby/Java Shop : My experiences at IGN

  • 1. Introducing Scala to your Java/Ruby Shop My experiences at IGN Manish Pandit Silicon Valley Code Camp ‘12 Oct 7th, 2012
  • 2. About me Manish Pandit Director of Engineering, IGN @lobster1234 linkedin.com/in/mpandit
  • 3. About IGN We are a leading online media and services company obsessed with gaming and entertainment. 56MM Monthly Unique Views 737MM Monthly Page Views 20MM Monthly Video Views
  • 4. My Objective Is: To share my story of introducing Scala to IGN, and (hopefully) show you the path to enlightenment. Isn't: To incite a functional vs. imperative, or Scala vs. ____ debate.
  • 5. The IGN Tech Stack
  • 6. Best tool for the job • Front End : JS, CSS3, HTML5, backbone, Coffeescript, jQuery • Middle Tier : ZF2 (PHP), Rails • APIs : Scala, some Java • Persistence : MongoDB, MySQL, Redis • Search : ElasticSearch • Caching : Memcached, Varnish
  • 7. APIs at IGN : Numbers • ~5 Billion requests a month • Average Response time of under 20ms on cache misses • 17 APIs between Social, OAuth, and Content • Hardest hit APIs doing about 25K RPM at peak
  • 8. The Kitchen Sink • CMS – JSPs talking to Oracle DB and some Java services • V1 API : Java Services using Oracle DB with Memcached • V2 API : Rails based API layer using MongoDB and a Java/Memcached front cache • Lots of duct tape like messaging and cron jobs for simple tasks • Too diverse of a stack in the API infrastructure
  • 9. The API Evolution : V3 [2012] • A fresh look at the APIs and IGN’s direction • First attempt to – Integrate all content types – Open up the APIs to external consumers – Evolve the CMS, traditionally a monolithic system – ElasticSearch – Varnish Response Caching • A learning opportunity for traditional Java stack engineers
  • 10. Roadblocks • Resistance to change – Culture – Willingness and commitment • Too many choices – making the right pick – Involve every one – Do not decide by committee, decide by learning – Time box and measure everything – Be accountable, as you’re looked upon as the expert
  • 11. The hunt for… • A runtime as fast, if not faster than Java • Concise, yet expressive • Less boilerplate • Smooth learning curve and ramp up • Re-use ecosystem of libraries • Growing adoption and developer velocity • Built in support for concurrency • Fast and fun development • Next level of programming – disrupt!
  • 12. Why Scala : Strategic Reasons • Evolve the talent brand along side evolving the platform • Establish an API platform by replacing “rewrite” with learning instead of porting • Start thinking functional • Align with the leaders in the APIs • Get involved with a technology as it is evolving (vs. established). Helps with influence.
  • 13. Why Scala : Tactical Reasons • Performance tied to cores than processor speed, i.e. concurrency • Ideal for API development – (relatively) simple to handle concurrency and immutability • JVM based = Performance • Re-use Java toolkits and libraries • Concise, yet expressive code • Actor model makes the difficult parts easy
  • 14. Why Scala : Tactical Reasons • Richer Collections API • Traits enabling Mix-Ins and behavior re-use • Statically Typed w/Type inference • Functional, but not alien (it can be!) • REPL
  • 15. Yes, Virginia, Scala is hard : DPP So, how can you figure out if Scala will be "easy" or "hard" for your organization: •Your company has speakers at JavaOne, OSCON, Strangle Loop, QCon: Scala will be easy •Lunch-time discussions involve the criteria for moving from a developer to a senior developer: Scala will be hard •Your developers can write code in NotePad if they have to: Easy •Your developers stare blankly or say 3 "Hail Marys" when they hear the name "Zed Shaw": Scala == Hard •Developers all follow Dean Wampler on Twitter: Scala Easy •Your developers come in at 9:15 and leave before 6 and don't check work email at night: Hard http://blog.goodstuff.im/yes-virginia-scala-is-hard
  • 16.
  • 17. Picking up Scala : Week 1 • Scala for Java Developers fast-tracked the learning • Syntax Familiarity • Java without semicolons? def total(nums: List[Int]) :Int = { var sum:Int=0 for(num<-nums) { sum+=num } sum }
  • 18. Picking up Scala : Week 4 • Reduce the lines of code, embrace immutability, use the functional paradigms built into the language • Unmystrify the implicits magic nums.foldLeft(0)((n,c) => n+c)
  • 19. Picking up Scala : Today • Focus on immutability • Think functional – with the knowledge gained from using the functional aspects of the language, build control abstractions • Explore and implement ScalaZ • Keep learning, and applying • Move all the Actor processing to Akka
  • 20. Less Boilerplate public class HelloWorld{ public static void main(String... args){ System.out.println("Hello, World!"); } } object HelloWorld extends App{ println("Hello, World!") } scala> println("Hello, World!")
  • 21. Expressive, yet concise val x = if(n%2==0) "Even" else "Odd" val x = for(i <- 1 to 10) yield i*2 val x = for(i <- 1 to 10; if(i%2==0)) yield i*2 val y = 20 match{ case p if(p%2==0) => "Even" case _ => "Odd" } val largest = List(1,5,2,6).foldLeft(0)((a,b)=> if(a>b) a else b)
  • 22. Less pain points No more dreaded null or throwing unwanted exceptions : Use Option[T] def thisMayReturnNull[T](x:T):Option[T]={ if(true) Some(x) else None } No more creating classes only to return more than 1 value : Use Tuples def doublePair(x:Int)= (x,x*2)
  • 23. Try-catch mess try{ //Construct a URL which can throw a MalformedURLException //do something with a URL which can throw IOException //do something with string encoding which can throw // UnsupportedEncodingException } catch{ case mal:MalformedURLException => //something case ioe: IOException => //something case e: Exception => //something }
  • 24. Type Inference scala> val x = "Sunday" x: java.lang.String = Sunday scala> def x(n:Int) = n*3 x: (n: Int)Int scala> 1 to 5 res2: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3, 4, 5) scala> def x = if(true) Left("Yes!") else Right(new Exception("Didn’t work out!")) x: Product with Serializable with Either[java.lang.String,java.lang.Exception]
  • 25. Dynamic Mix-ins class Home(bedrooms:Int=3,bathrooms:Double=2.5) trait Garage{ def park(n:Int) = println("Parking " + n + "cars") } val someHome = new Home val someHomeWithGarage = new Home with Garage someHomeWithGarage.park(2)
  • 26. Concurrency • Actors make concurrency so much easier – Messaging vs. Blocking – Lightweight, 300-500 bytes per instance – Isolated
  • 27. Scala API Components • Scalatra • Lift-MongoRecord for MongoDB • Casbah for MongoDB • PlayFramework 2 • Actors for tasks like syndication • sbt and Maven for Builds • MongoDB for persistence
  • 28. Other API Components • Varnish Cache • Elasticsearch • Yammer Metrics (ping, healthcheck) • Swagger (self-documenting RESTful APIs) • 3Scale for Partner APIs • IntelliJ IDEA and Eclipse with ScalaIDE • PlayFramework 2.0 (New!) • ScalaTest for Testing
  • 29. Challenges with Scala * • Steepness of the Learning curve depends entirely on your org culture • Scala is what you make of it • http://scalaz.github.com/scalaz/scalaz-2.9.1- 6.0.4/doc.sxr/scalaz/BKTree.scala.html • Middle Ground between Simplicity and, well..elegance * None of these challenges outweigh the benefits. They’re just something to be aware of.
  • 30. Challenges with Scala • Slow compilation based on the source • No (binary) compatibility of dependencies for the major releases (2.8, 2.9, 2.10(?)) • Tooling not as rich as Java – Changing (rapidly) with Typesafe investing in ScalaIDE – ScalaIDE comes with a Scala Worksheet, which is like REPL but richer
  • 31. Lessons Learned : Culture • Culture of Meetups, Hack Nights and Code Jams • Being able to connect with the contributors and language creators • Willingness to invest in learning, evolving vs. maintaining
  • 32. Lessons Learned : Team • Small team (~5 engineers) • Java background helped a lot • 10% time set aside for skill building • Learn and share • It is a commitment • Communication!
  • 33. Lessons Learned : Material • Books that have exercises, so you can quantify your learning. • Online tutorials • StackOverflow • Coursera : A course on Functional Programming by Martin Odersky
  • 34. Resources • Books – Programming in Scala by Odersky – Scala for the Impatient by Horstmann • Interwebz – http://debasishg.blogspot.com – http://www.reddit.com/r/scala – http://stackoverflow.com/tags/scala/info – http://twitter.github.com/scala_school – https://www.coursera.org/course/progfun
  • 35. scala> case class Me(name:String="Manish Pandit",twitter:String="@lobster1234") defined class Me scala> val me = new Me me: Me = Me(Manish Pandit,@lobster1234) scala> println(“Questions!”) Questions!

Editor's Notes

  1. ----- Meeting Notes (10/4/12 16:32) ----- Scala in production? Playing around with Scala?