scala fs 2012

18
@diego_pacheco Software Architect | Agile Coach about.me/diegopacheco 1

Upload: diego-pacheco

Post on 10-May-2015

2.464 views

Category:

Technology


2 download

DESCRIPTION

Scala FS 2012First Scala presentation at Functional Society

TRANSCRIPT

Page 1: Scala FS 2012

@diego_pachecoSoftware Architect | Agile Coachabout.me/diegopacheco 1

Page 2: Scala FS 2012

Java 1.3 - 2000NEW Javac 1/3

smallerGenerics, Right?

Functional Programming (map, filter, foldLeft, foldRight, flatMap, etc..) Functions as First Class Citizen Lambda/Closure Higher Order Functions, Currying and monads Parallel Collections (for multi-core processors) Evolutionary OO (case class, object, trait, pattern matcher, with*) You can use same jars/frameworks (Spring, Hibernate, Junit, etc..) Solid Documentation, Books, websites, blogs, community, twitter, etc… Static Typing BUT Scala has Duck Typing Runs on the JVM Awesome interoperability with Java Same java tooling – Eclipse – Scala IDE (Not Perfect ) Less noise, do more with less code than Java (LOC x2)

2001 - EPFL

Why Scala?

Martin Odersky2

Page 3: Scala FS 2012

3

Page 5: Scala FS 2012

Scala Code: case classes

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/caseclass/CaseClass.scala

5

Page 6: Scala FS 2012

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/basic/loop/MoreAdvancedFunWithForExpression.scala

6

Page 7: Scala FS 2012

7

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/basic/oo/MathOverload.scala

Scala Code: Operator Overload

Page 8: Scala FS 2012

Scala Code: Functional Programming

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/basic/reduce.scala

8

Page 9: Scala FS 2012

Scala Code: Traits & Mixings

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/basic/oo/traits/SelectiveTraits.scala

9

Page 10: Scala FS 2012

Scala Code: Lambda/Closure

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/clojure/AnonymousFunction.scala

10

Page 11: Scala FS 2012

Scala Code: Currying

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/currying/CurryingFunctions.scala

11

Page 12: Scala FS 2012

Scala Code: Currying

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/currying/CurryingFunctions.scala

12

Page 13: Scala FS 2012

Scala Code: Specs2

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/specs2/Specs2.scala

13

Page 14: Scala FS 2012

Scala Code: Pattern Matcher

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/pattern/matching/PatternMatching.scala

14

Page 15: Scala FS 2012

Scala Code: DSL

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/blob/master/scripts/scala/scala-playground/src/com/github/diegopacheco/sandbox/scripts/scala/typesystem/implicits/ImplicitsConversions.scala

15

Page 16: Scala FS 2012

Resourceshttp://www.scala-lang.org/http://twitter.github.com/scala_school/http://scalatypes.com/http://akka.io/http://typesafe.com/

https://github.com/diegopacheco/Diego-Pacheco-Sandbox/tree/master/scripts/scala

16

Page 18: Scala FS 2012

@diego_pachecoSoftware Architect | Agile Coachabout.me/diegopacheco

Thanks!Obrigado!

18