short and fast introduction to scala

Post on 05-Apr-2017

348 Views

Category:

Engineering

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

A short and really fast Scala Introduction

Sergi González

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

Why Scala?

• Java Virtual Machine

• Concurrency

• Functional and Object Oriented

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…

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:

Why Scala

Variables and Values

If, while, functions …

Pattern Matching

Pattern Matching

Pattern Matching

Pattern Matching

Pattern Matching

Recursive functions + Pattern Matching = WIN

Lists and more…

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

OOP

OOP

Traits, Objects, Generics,

Multiple Inheritance…

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

top related