Want to dive even deeper?

Take the course Stairway to Scala Applied II by Bill Venners and Dick Wall and become an expert!
Stairway to Scala Applied II
by Bill Venners , Dick Wall

Check it out!
You're watching a preview of this video, click the button on the left to puchase the full version from Paris JUG.

Keynote - Scala in 2018

It's 2018. Scala is now 15 years old and the dominant programming language for enterprise apps. But how did we get here? What hurdles did we tackle and what hurdles tackled us?

Published on
  • 23.202
  • 34
  • 32
  • 96
  • 37
  • What to Talk About… ?
  • The History of Poetry?
  • The History of Poetry?
  • The Perl School  Computer language poetry proposed in 1960s  First poems written in Algol in 1970s  Perl’s design allowed for poetry:  I know it’s weird, but it does make it easier to write poetry in perl – Larry Wall on a Perl feature, 1990
  • Black Perl BEFOREHAND: close door, each window & exit; wait until time. open spellbook, study, read (scan, select, tell us); write it, print the hex while each watches, reverse its length, write again; kill spiders, pop them, chop, split, kill them. unlink arms, shift, wait & listen (listening, wait), sort the flock (then, warn the "goats" & kill the "sheep");
  • Ode to Scala I love her silken symmetry; Her supple form entices (oh yes) Enraptures - entraps – me!   I love this it's heaven; Yet import pain.                    _ Sh*t  Why     this synchronized torment?   Heaven & hell
  • Ode to Scala if (she says) "Your love is not enough” (Resist, resist, resist) "I find your lack of faith disturbing.” Be not obsessed. Relax This map suffices That way madness lies; I say "It IS enough"
  • Ode to Scala class warfare extends ghetto (filled) with suffering if (easily angered) throw under the bus object ridicule extends warfare ridicule hurts class unity extends community with joy 1000 fold Remember The     wheel is not a new idea with Scala Remember & rejoice print { money }
  • Scala in 2018 How Scala Became a Mainstream Language
  • 2018: The Leading Newer Language  Scala has broken out of the pack  Biggest thing since Java  Language fragmentation here to stay  Specialization  No new blockbuster languages
  • 2018: Java Endures
  • 2018: Java Endures  Java is regularly pronounced dead  Deeply uncool  In reality, it’s not going away any time soon  Good for Scala, as its fate is linked to that of Java
  •  Not just about Java, it’s the JVM  An amazing piece of software
  • 2018: Users of Scala  Scala’s niche: Leading enterprise language  Traditional enterprise apps  Twitter-like category of super high demand consumer apps  Part of a messy world…  Java and Scala often mixed  DSLs an important niche for Scala
  • 2018: Who Doesn’t Use Scala?  The mythical “corporate developer”  Scala is not adopted by millions  Startups less likely to use Scala  Still hate the JVM  Still love dynamic languages  May rewrite in Scala if they encounter the Twitter scenario  Front end no longer on the JVM  Predominantly JavaScript
  • How Did Scala Win?  Moved toward the mainstream  Embraced Java ecosystem  Chose to fight only winnable battles  Scala language innovation slowed down, improving backward compatibility, compiler and tooling
  • Oh No!
  • Sometimes It’s Good to Sell Out
  • Some Successful Sellouts Tony Flow and the Miraculously Majestic Masters of Red Hot Chilli Peppers
  • …some Successful Sellouts Mother Mcree’s Uptown Jug Champions Grateful Dead
  • Confession: I am Biased
  • Confession: I am Biased  Have coded purely in Scala for the last year  I love Scala more than any language since C  Doubt I will program in Java again  Chose to join Typesafe board
  • Confession: I am Biased  Have coded purely in Scala for the last year  I love Scala more than any language since C  Doubt I will program in Java again  Chose to join Typesafe board  Pretty typical background for a Scala adopter  Enterprise software experience  Java background
  • Why Scala is Awesome  Not verbose like Java  Amazingly flexible for a strongly typed language  I’ve always liked type safety  Elegant combination of OO and functional  Best code reuse I’ve seen
  • Why Java Sucks  Verbose and error-prone     Lack of default method arguments Constructor duplication Getters/setters …  Immutability doesn’t feel as natural  Comparative lack of code reuse
  • Why Java is Awesome… Reason Scala response JVM is robust and performant Scala runs on the JVM Awesome tooling • Strong typing helps tooling • Improving in Java-based IDEs Community of pragmatic programmers focused on solving real world problems Mixed community, includes purists and zealots
  • …Why Java is Awesome Reason Scala response Great backward compatibility Poor backward compatibility Powerful libraries and frameworks • Consume Java libraries easily • Ignore Java solutions and rewrite in Scala Restrictive language Flexible language a blessing & a curse Culture of readable code Culture of unreadable clever code
  • Lessons for Scala From Java’s Popularity  No accident Java is #1  Learn from Java’s successes as well as its failures  Play nice with Java, rather than totally rejecting it
  • Myths That Hold Us Back
  • Myth #1: It’s Good to be Clever def templateContent: Parser[(List[Simple], List[Def], List[Template], List[TemplateTree])] = {         (several(importExpression | localDef | template | mixed)) ^^ {           case elems => {             elems.foldLeft((List[Simple](), List[Def](), List[Template](), List[TemplateTree] ())) { (s, e) =>               e match {                 case i: Simple => (s._1 :+ i, s._2, s._3, s._4)                 case d: Def => (s._1, s._2 :+ d, s._3, s._4)                 case v: Template => (s._1, s._2, s._3 :+ v, s._4)                 case c: Seq[_] => (s._1, s._2, s._3, s._4 ++ c.asInstanceOf[Seq[TemplateTree]])               }             }           }         }       }
  • With Great Power Comes Great • Implicit conversions • Implicit parameters • Operator overloading • Ability to use unicode charset in identifiers • Renaming imports • Type inference • Powerful collection library with baffling internals • …
  • With Great Power Comes Great • Implicit conversions • Implicit parameters • Operator overloading • Ability to use unicode charset in identifiers • Renaming imports • Type inference • Powerful collection library with baffling internals • … Cannot simply deny this and argue language is simple
  • Lessons from C / C++
  • Lessons from C / C++
  • Advantages of Languages in Which You Can’t Write Poetry…  Also hard to hang yourself  Java’s success was partly due to being less powerful than C++
  • Advantages of Languages in Which You Can’t Write Poetry…  Also hard to hang yourself  Java’s success was partly due to being less powerful than C++  Java 8…  Good for Scala, bad for Java?  But we don’t want anything bad for Java
  • Dispatch “periodic table”  Need to translate into English a design smell  Good code is self documenting
  • About Readability, Not LOC
  • About Readability, Not LOC java is much better suited for big teams *because* it's a stupid language that feels like you're coding with yours [sic] hands bound. the more humans you add to a group, the more stupid each individual gets, even if they all are geniuses.
  • About Readability, Not LOC Any fool can write code that a compute can understand. Good programmers wri code that humans can understand – Mart Debugging is twice as hard as writing th code in the first place. Therefore, if you write the code as cleverly as possible, yo
  • Need Scala Coding Standards  Can do the same thing in many different ways  Poetry may not be good code  Need to converge on one good way  Something the Rails guys did well with Ruby  Need clear division between application developer and library developer roles  Martin Odersky “Levels”: http://www.scalalang.org/node/8610  Don’t make application developers do bizarre stuff
  • Myth #2: Ignorance Should be Punished
  • Myth #2: Ignorance Should be Punished If your coworkers are idiots, that's really a problem with your coworkers.
  • Myth #2: Ignorance Should be Punished If your coworkers are idiots, that's really a problem with your coworkers. You even said "avoid answering Scala questions with Haskell." Fuck you Kevin. If I feel it is appropriate to answer with Haskell, I will do exactly that -- I really don't care that you do not understand.
  • Lessons From Other Communities  Groovy  Poor language, great community  People are welcomed, not abused  It’s OK to write in Java at first  Spring  Culture of respect in forums  Karma works  Respect breeds respect
  • Facts To Remember  Most of those who will use Scala in 2018 aren’t using it today  Where will they come from?  All leading languages are similar to Java  Java community 52x larger than Haskell community  How do we welcome them?  What do they need to be productive and adopt Scala incrementally?  Make their first weeks enjoyable, not humiliating
  • Myth #3: OO is Bad  Shouldn’t feel guilty for using OO design  OO is a valuable and proven paradigm  Scala is a better OO language than Java  If you hate OO programming, go write Haskell or Lisp
  • Myth #4: We Don’t Need Frameworks Language so good we don’t need no lousy frameworks
  • Myth #4: We Don’t Need Frameworks Language so good we don’t need no lousy frameworks  It’s not just about the language  Much real world programming has little to do with elegant expression of algorithms
  • Myth #4: We Don’t Need Frameworks Language so good we don’t need no lousy frameworks  It’s not just about the language  Much real world programming has little to do with elegant expression of algorithms  Like saying we have a fast car, so we’ll use the time we save to build our own road
  • Myth #5: Java Sucks and Java Coders Aren’t as Smart as Us  Tendency to dismiss Java viewpoints and libraries  Typical arrogance of a young community  Appropriate for a while
  • Exhibit A: Scala ORM in Theory I think we really need SIQ or whatever we call it shipping as soon as possible. Being able to say here are the hundreds of lines of code you need to work with a database:   you need some classes for ORM,   dozens of annotations to describe the connection between them  dozens of lines for simple type safe queries  you need to know the quirks of Hibernate/JPA/EclipseLink and   you probably still need to write SQL for more complex tasks and here is how you do that in Scala, with a single line of code: <example> I think if we would have this, we have more or less won the whole enterprise stuff.
  • Exhibit A: Scala ORM in Practice val withAthleteAndComments = { (Workout.withAthlete ~ Comment.simple *) map { case all => all.groupBy(_._1).headOption.map { case (workoutWithAthlete, comments) => " " (workout, athlete, comment.map(_._2)) } } } That will get you a Option[((Workout,Athlete),List[Comment])]
  • Embrace it: Java Ecosystem is a Huge Benefit to Scala  A key strength  Not an embarrassment  Shouldn’t assume we can do everything better in Scala
  • Myth #6: Purity Matters What if many people are wrong? It's not as if there aren't countless examples of many people sharing the same mistake, surviving only by patting each other on the back, confirming the perpetuity of the mistake.
  • Myth #6: Purity Matters What if many people are wrong? It's not as if there aren't countless examples of many people sharing the same mistake, surviving only by patting each other on the back, confirming the perpetuity of the mistake. val withAthleteAndComments = { (Workout.withAthlete ~ Comment.simple *) map { case all => all.groupBy(_._1).headOption.map { case (workoutWithAthlete, comments) => " " " (workout, athlete, comment.map(_._2)) } } }
  • Myth #5: It’s All About New Language Features  Mainstream languages can’t progress like the wind  Backward compatibility matters  Scala will win as an enterprise language  Scala needs to be more boring
  • The Only Thing that Needs to Go Faster is the Compiler  Compiler is slow and buggy  C++ eventually solved those problems  Language is a moving target  Makes it harder for new adopters to learn
  • My 2c On Language Innovation  New language features like macros not highest priority  Need to create two language profiles  Academic experimental tool  Drive the future  Subset: Scala for working developers  Stable, small footprint  Need to be paranoid about footprint
  • Conclusion
  • A Critical Moment  Scala has a great chance of being the next big enterprise language  Less likely to appeal to startups  The Scala community will determine what happens next  What will Scala be when it grows up?  Do we want it to be mainstream?
  • How Scala Becomes Mainstream  Community needs to evolve more than the language  More pragmatic  More welcoming of newbies  Coding standards need to be developed and adopted  Need to embrace the Java ecosystem and Java  Need to stop reinventing wheels  Scala language innovation needs to slow down
  • The Journey Has Already Begun… Welcome     new era with boundless       potential   Thread sleep sweetly. Enough.  §