
A quick run-through of the reasons why people are so excited about Scala
Let's plunge in! Setting up Scala is surprisingly simple. You do need Java though.
Immutable variables are a big part of Scala - understand why.
Scala aims to achieve the best of both worlds: rapid prototyping like Python, type safety like Java, C++ and other statically typed languages.
Scala has 3 types that unify the type system: Any (literally anything!), AnyRef (supertype to all reference types) and AnyVal (supertype to all value types)
Nil, null, Null, Nothing, Unit..Scala has many ways to skin a non-existent cat!
This is an important semantic difference - statements don't return a value, while expressions do. Scala converts many familiar constructs into expressions - which allows them to be composed.
Expression blocks are prototypical "r-values", i.e. they sit on the right of assignment statements.
Scala has if-else expressions (not if-else statements). This is a fine point, and an important one.
Pattern matching is very easy in Scala - this is a more popular language construct than if/else expressions
Scala has a way to convert for loop statements into for loop expressions - using 'yield'
While loops are pure statements, and are rather clunky. See why they are not the most popular construct in town.
Functions are 'first class citizens' in Scala - this actually has a technical term!
Scala allows parameters to be specified out of order - using their names
Yet another mechanism to encourage code re-use
Scala loves using formidable terms for everyday concepts:-) Think generics in Java.
Functions that take in other functions as parameters, or return function objects, are called Higher Order Functions
Partially Applied Functions are a really cool code re-use trick: fix some (but not all) parameters of a function and you have a new function!
These 65 examples will make this cool-new-kid-on-the-block your steady, reliable friend
Let's parse that.
What's Included: