Introducing Functional Programming2:20 with andi mitre
In this video, we’ll define functional programming and compare differences with imperative programming. We will discuss how Scala originated and how it’s used in the real world. We will touch upon when it is a good idea to use Scala.
Functional Programming -- Functional programming is a programming style or paradigm which focuses on the idea of treating functions as first class citizens as well as avoiding mutable data structures and changing state
[MUSIC] 0:00 Hi I'm Andi and welcome to introduction to Scala. 0:05 Scala is a functional programming language 0:08 which runs on top of the Java virtual machine and can use any Java class. 0:11 Scala's design began in 2001 and Martin Odersky who had previously worked on 0:16 Java C, Sun's Java compiler ultimately released it in 2003. 0:21 Syntactically, Scala is much more concise than Java. 0:26 And a majority of the time, it avoids a lot of repetitive type information. 0:30 The efficiency of compiled Scala programs is usually equivalent to Java's. 0:35 We mentioned that Scala is a functional programming language. 0:40 But what does that really mean? 0:43 Functional programming is a programming style or 0:45 paradigm which focuses on the idea of treating functions as first class 0:47 citizens, as well as avoiding mutable data structures and changing state. 0:52 The idea of functions as first class citizens implies that functions 0:57 can be treated as values. 1:01 And can be passed around to other functions or even stored in variables. 1:03 Additionally, you can define functions without a name or 1:08 even define functions inside other functions. 1:11 The second idea around functional programming is that a program should never 1:14 change data in place. 1:18 But rather map input values to output values. 1:20 Tying the ideas of functional with object oriented programming 1:23 makes Scala quite a powerful language. 1:26 Scala's adoption has increased tremendously. 1:29 Many companies such as LinkedIn, Netflix, Foursquare, Airbnb, 1:32 and Ebay have begun to use it in various projects. 1:36 LinkedIn uses Scala on a real time streaming and 1:40 processing framework known as Samza. 1:42 Another giant, Twitter, has implemented scalding, a Scala library for 1:45 Hadoop MapReduce jobs. 1:49 Hadoop MapReduce is a programming paradigm which consists of two tasks, 1:51 a mapper and a reducer. 1:56 The map job processes input data into key value pairs, and the reduce job 1:58 takes those key value pairs and aggregates them to produce a final data set. 2:03 [SOUND] Apache Spark a very popular big data processing engine is also 2:07 written in Scala. 2:12 In the following videos we'll dive deeper into Scala and 2:13 write our first pieces of code with our superhero project. 2:16
You need to sign up for Treehouse in order to download course files.Sign up