SlideShare uma empresa Scribd logo
1 de 29
Scala for C# Developers
Omer van Kloeten
Hi!
 CTO at
 Eight years working in C#
 Two years suffering Java
 Two years enjoying Scala
 newBrandAnalytics
 AppMyDay
What is Scala?
 JVM Language
 Academic roots
 Released 2003
 Maintained by TypeSafe
 Continuously updated
Why should I care?
 CLR vs. JVM
 The Hummus Manifesto
 Java is old, Scala is the new hotness
 Learn, learn, learn
Who uses Scala?
Similar Backgrounds
 Trying to replace Java
 Benevolent Dictators
 Design-by-committee sucks!
 Strongly and statically typed
 Object-functional
Imperative vs. Functional
Imperative C# Functional LINQ…
…But In Reality
Functional First
Functional C# Functional Scala
 Slight differences
 Underscores… underscores everywhere!
 Strict (immediate) vs. Non-Strict (lazy)
 people.view().filter…
 Lots more than we can cover here…
Syntax Doesn’t Matter, Right?
C#
 class Foo: Bar, IBaz
 class Foo<TBar>
 interface IFoo
 int foo(string s) { return 42;
}
 ...
Scala
 class Foo extends Bar with Baz
 class Foo[TBar]
 trait Foo
 def foo(s: String) = 42
 ...
Syntax Doesn’t Matter,
Defaults Do
C#
 Private by default
 Non-virtual by default
Scala
 Public by default
 Virtual by default
 Java mentality
Immutable By Default
 val and var
 C#’s readonly
 lazy val
 .NET’s Lazy[T]
 Collections
Tuples and Case Classes
 Tuples
 First-class citizen
 Completely typed
Tuples and Case Classes
 Tuples
 First-class citizen
 Completely typed
 Case classes
 Easy, immutable types
Everything Is An Expression
Pattern Matching: Basics
Pattern Matching: Unapply
Pattern Matching: Collections
Pattern Matching: Summary
 switch/case on steroids
 First-class language construct
 Statically checked for comprehensiveness
What Scala Doesn’t Have
 A fast compiler
 C#’s value types
 Built-ins
 Structs
 Enums
 Partial types and methods
 Getters and Setters
 Well, no, but…
 Native for or foreach support
Wait, what?!
Well, kinda… ...is translated to:
Language Topics Not Covered :(
 Streams
 Type inference
 Tail recursion
 Multiple inheritance
 Operators
 Implicits
 Structural Type Definitions
 Companion objects
 Parallelization and
concurrency
 Monads
 Macros
 Reflection
 More underscores!
Tooling and Libraries
 Almost twenty years of Java
 Scala wrappers
 Great community
 Engineers
 Scientists
Tooling: IDEs
 Scala plugin
 JetBrains
 of ReSharper fame
 Scala over Eclipse
 TypeSafe
 Maintainers of Scala
NetBeans, Sublime, etc.
Tooling: REPL
Tooling: Build System
Maven
 Better than Ant
 Bloated
 Written in Java for Java
SBT
 Simple Build Tool
 Irony
 Written in Scala for Scala
Frameworks
 Web Frameworks
 Play! Framework
 Lift
 Scalatra
 Object-Relational Mappers
 Slick
 Squeryl
 Unit Testing
 Specs2
 ScalaTest
Where Do I Start?
 Base stuff:
 Download and install latest JDK (from oracle.com)
 Go to http://scala-lang.org/downloads, download
and install the MSI
 IntelliJ IDEA:
 Go to http://jetbrains.com/idea/download,
download and install the Community Edition
 Demo
Where Do I Start?
 Twitter’s Scala School
 A Tour of Scala
 Another Tour of Scala
 Functional Programming Principles in Scala
 Scala By Example (PDF)
 Programming in Scala (Book)
Thank you
Questions?
@omervk

Mais conteúdo relacionado

Semelhante a Scala for C# Developers

Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San FranciscoMartin Odersky
 
Scala
ScalaScala
Scalasryx
 
Why Scala Presentation
Why Scala  PresentationWhy Scala  Presentation
Why Scala Presentationguestc185e0e
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?Alex Payne
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaScala Italy
 
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJAX London
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JSKnoldus Inc.
 
Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-partsFuqiang Wang
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scalafanf42
 
Java Closures
Java ClosuresJava Closures
Java ClosuresBen Evans
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...Maarten Balliauw
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8icarter09
 
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.
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationMartin Odersky
 
Absorbing Scala Into Java Ecosystem
Absorbing Scala Into Java EcosystemAbsorbing Scala Into Java Ecosystem
Absorbing Scala Into Java EcosystemEishay Smith
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapDave Orme
 

Semelhante a Scala for C# Developers (20)

Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Scala
ScalaScala
Scala
 
Why Scala Presentation
Why Scala  PresentationWhy Scala  Presentation
Why Scala Presentation
 
Scala
ScalaScala
Scala
 
Why Scala for Web 2.0?
Why Scala for Web 2.0?Why Scala for Web 2.0?
Why Scala for Web 2.0?
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
Devoxx
DevoxxDevoxx
Devoxx
 
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben EvansJava Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
Java Core | Modern Java Concurrency | Martijn Verburg & Ben Evans
 
Introduction to Scala JS
Introduction to Scala JSIntroduction to Scala JS
Introduction to Scala JS
 
Java Basic PART I
Java Basic PART IJava Basic PART I
Java Basic PART I
 
Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-parts
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
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
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
Sadiq786
Sadiq786Sadiq786
Sadiq786
 
Absorbing Scala Into Java Ecosystem
Absorbing Scala Into Java EcosystemAbsorbing Scala Into Java Ecosystem
Absorbing Scala Into Java Ecosystem
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
 

Último

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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
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
 
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 XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation 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
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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
 
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
 
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
 
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
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
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
 

Último (20)

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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
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
 
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...
 
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
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
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
 

Scala for C# Developers

  • 1. Scala for C# Developers Omer van Kloeten
  • 2. Hi!  CTO at  Eight years working in C#  Two years suffering Java  Two years enjoying Scala  newBrandAnalytics  AppMyDay
  • 3. What is Scala?  JVM Language  Academic roots  Released 2003  Maintained by TypeSafe  Continuously updated
  • 4. Why should I care?  CLR vs. JVM  The Hummus Manifesto  Java is old, Scala is the new hotness  Learn, learn, learn
  • 6. Similar Backgrounds  Trying to replace Java  Benevolent Dictators  Design-by-committee sucks!  Strongly and statically typed  Object-functional
  • 7. Imperative vs. Functional Imperative C# Functional LINQ… …But In Reality
  • 8. Functional First Functional C# Functional Scala  Slight differences  Underscores… underscores everywhere!  Strict (immediate) vs. Non-Strict (lazy)  people.view().filter…  Lots more than we can cover here…
  • 9. Syntax Doesn’t Matter, Right? C#  class Foo: Bar, IBaz  class Foo<TBar>  interface IFoo  int foo(string s) { return 42; }  ... Scala  class Foo extends Bar with Baz  class Foo[TBar]  trait Foo  def foo(s: String) = 42  ...
  • 10. Syntax Doesn’t Matter, Defaults Do C#  Private by default  Non-virtual by default Scala  Public by default  Virtual by default  Java mentality
  • 11. Immutable By Default  val and var  C#’s readonly  lazy val  .NET’s Lazy[T]  Collections
  • 12. Tuples and Case Classes  Tuples  First-class citizen  Completely typed
  • 13. Tuples and Case Classes  Tuples  First-class citizen  Completely typed  Case classes  Easy, immutable types
  • 14. Everything Is An Expression
  • 18. Pattern Matching: Summary  switch/case on steroids  First-class language construct  Statically checked for comprehensiveness
  • 19. What Scala Doesn’t Have  A fast compiler  C#’s value types  Built-ins  Structs  Enums  Partial types and methods  Getters and Setters  Well, no, but…  Native for or foreach support
  • 20. Wait, what?! Well, kinda… ...is translated to:
  • 21. Language Topics Not Covered :(  Streams  Type inference  Tail recursion  Multiple inheritance  Operators  Implicits  Structural Type Definitions  Companion objects  Parallelization and concurrency  Monads  Macros  Reflection  More underscores!
  • 22. Tooling and Libraries  Almost twenty years of Java  Scala wrappers  Great community  Engineers  Scientists
  • 23. Tooling: IDEs  Scala plugin  JetBrains  of ReSharper fame  Scala over Eclipse  TypeSafe  Maintainers of Scala NetBeans, Sublime, etc.
  • 25. Tooling: Build System Maven  Better than Ant  Bloated  Written in Java for Java SBT  Simple Build Tool  Irony  Written in Scala for Scala
  • 26. Frameworks  Web Frameworks  Play! Framework  Lift  Scalatra  Object-Relational Mappers  Slick  Squeryl  Unit Testing  Specs2  ScalaTest
  • 27. Where Do I Start?  Base stuff:  Download and install latest JDK (from oracle.com)  Go to http://scala-lang.org/downloads, download and install the MSI  IntelliJ IDEA:  Go to http://jetbrains.com/idea/download, download and install the Community Edition  Demo
  • 28. Where Do I Start?  Twitter’s Scala School  A Tour of Scala  Another Tour of Scala  Functional Programming Principles in Scala  Scala By Example (PDF)  Programming in Scala (Book)

Notas do Editor

  1. Image CC-BY-NC-SA, Alejandro Crosa http://www.flickr.com/photos/alejandrocrosa/5247567841/New version every yearBugfixes every few months
  2. Logos are copyright their respective owners
  3. Anders HejlsbergMartinOdersky
  4. String is immutable in C#
  5. Match values, typesUnderscore syntax
  6. Underscore syntax
  7. While is still while
  8. In .NET: MSBuild,NAnt, Cruise Control.NET
  9. Play, like ASP.NET MVC – LinkedIn, KloutLift, like ASP.NET – FoursquareScalatra, like NancyFX – LinkedIn, The Guardian
  10. Photo CC-BY, Ian Muttoo http://www.flickr.com/photos/imuttoo/2123301945/