short and fast introduction to scala

17
A short and really fast Scala Introduction Sergi González

Upload: sergi-gonzalez-perez

Post on 05-Apr-2017

348 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Short and fast introduction to Scala

A short and really fast Scala Introduction

Sergi González

Page 2: Short and fast introduction to Scala

http://www.slideshare.net/sergigp/short-and-fast-introduction-to-scala

Page 3: Short and fast introduction to Scala

Why Scala?

• Java Virtual Machine

• Concurrency

• Functional and Object Oriented

Page 4: Short and fast introduction to Scala

Why Scala?• Immutable

• First Class Functions

• Type Interface

• Traits (oh yes!)

• Pattern Matching

• Actors (SPOILER ALERT)

• The IDE ❤

• ScalaTest

• Case classes, lazy, monads, implicits, Akka, Play, Spark…

Page 5: Short and fast introduction to Scala

Why Scala

In order to code less and save money in keyboards As a catalan lazy developer I want a programming language that makes for me the boilerplate

Feature:

Page 6: Short and fast introduction to Scala

Why Scala

Page 7: Short and fast introduction to Scala

Variables and Values

Page 8: Short and fast introduction to Scala

If, while, functions …

Page 9: Short and fast introduction to Scala

Pattern Matching

Page 10: Short and fast introduction to Scala

Pattern Matching

Page 11: Short and fast introduction to Scala

Pattern Matching

Page 12: Short and fast introduction to Scala

Pattern Matching

Page 13: Short and fast introduction to Scala

Pattern Matching

Recursive functions + Pattern Matching = WIN

Page 14: Short and fast introduction to Scala

Lists and more…

https://github.com/sergigp/scala-notes/blob/master/akamon/2_lists.sc

Page 15: Short and fast introduction to Scala

OOP

Page 16: Short and fast introduction to Scala

OOP

Traits, Objects, Generics,

Multiple Inheritance…

Page 17: Short and fast introduction to Scala

FizzBuzz• Given a number:

• If it’s multiple of 3 return “fizz”

• If it’s multiple of 5 return “buzz”

• If it’s multiple of 3 and 5 return “fizzbuzz”

• If it’s not multiple of 3 or 5 return the number