- A modern, statically typed programming language built upon the Java ecosystem
- Elegant mix of object orientation and functional programming paradigms
- Designed to be used by real developers, solving real-world problems
- Runs on the JVM, providing full interoperability with Java APIs
- By Martin Odersky, author of the modern `javac` compiler
- Understanding Scala requires understanding this mixture of concepts
- Scala attempts to blend three seemingly orthogonal paradigms of thought into one language. These are:
- Expressive syntax with static typing
- Functional programming and object-oriented programming
- Advanced language features and rich Java integration
- These traits pointedly address the modern demands of data science deployment.
- Responsiveness to data processing demands are at the core of ERI's business
- Maintaining our competative advantage necessitates evaluating and refining our practices
- Scala maturity and acceptence has passed an inflection point making it ready for adoption

- eBay
- ...
- Type inference
- Case classes
- Named and default arguments
- Tuples
- Lazy values
- In Scala, functions are objects, allowing program construction through the definition and composition of objects and functions.
- Therefore Scala enables the developer to focus on “nouns” or “verbs” in a program, depending on the modality that best expresses the problem at hand.
| Object-oriented programming | Functional programming |
|---|---|
| Composition of objects (nouns) | Composition of functions (verbs) |
| Encapsulated stateful interaction | Deferred side effects |
| Iterative algorithms | Recursive algorithms and continuations |
| Imperative flow | Lazy evaluation |
| Pattern matching |
[Scala in Depth][1]
- Scala also blends expressive syntax with static typing.
- Mainstream statically typed languages tend to suffer from verbose type annotations and boilerplate syntax.
- Scala takes a few lessons from the ML programming language and offers static typing with a nice expressive syntax.
- Code written in Scala can look as expressive as dynamically typed languages, like Ruby, while retaining type safety.
Procedural Approach
public int sumSquare(int[] list) {
int s = 0;
for(int i = 0; i < list.length; i++) {
s += list[i] * list[i];
}
return s;
}
int result = sumSquare(new int[] { 1, 2, 3}));
System.out.println(result);Functional Approach
val ar = Array(1,2,3)
def square(x:Int) = x * x
def add(s:Int,i:Int) = s+i
val result = ar.map(square).foldLeft(0)(add)
println(result)Recursive Approach
public class Fibonacci {
public static long fib(final int n) {
if (n < 2) {
return n
}
else {
fib(n - 1) + fib(n - 2)
}
}
}Recursive with Pattern Matching
def fib(i:Int):Int = i match {
case 0 => 0
case 1 => 1
case _ => fib(i-1) + fib(i-2)
}