No one will argue that IT is one of the fastest developing areas of engineering. New tools, approaches and ideas complete or even supersede the existing ones. One of the quickest growing technology stacks is the Scala language stack. In this blog we explore what makes this language awesome.
Language Design
Scala was designed to help write thread safe and laconic code. It overcomes some JVM limitations and provides features that could not be achieved in Java. Scala has a clean, expressive, and extensible syntax with lots of built-in shorthands for most common cases.
Since less code needs to be written to accomplish the same task, the programmer can now focus on the problem’s solution instead of spending the time for boilerplate code. It is especially nice if you pay your programmers for SLOC. Furthermore, Scala reduces the number of places mistakes can be made and hence improves implementation quality.
Here is a short list of Scala language and compiler features:
val i = 1 // Int
val s = "Hello, world!" // String
class Point(x: Int = 0, y: Int = 0)
new Point(y = 1) // Point(0, 1)
users.filter(_.lastVisitDate before today).map(_.email).foreach(sendNotification)
// Sending notifications to all users that visited our site too long ago
val sum = sumActor ? List(1, 2, 3) // sum == Future(6)
val x = sum.map(_ * 2) // x == Future(12)
Distributed Computations and Big Data
One of the fields where Scala found its widest application is distributed computing. Scala has great mechanisms for working with data sequences even in a cluster, which is why it is frequently used by Big Data engineers and data scientists. Here is a list of the most well-known technologies that use Scala:
In addition to these tools, it is also possible to use Scala for implementing good old Hadoop map-reduce jobs, directly or utilizing Scalding. Anyway Scala is a great choice for data processing and distributed computing.
Compatibility with Java
One more important thing is compatibility with libraries written in Java. Java code can be used in Scala directly and without limitations. This allows to keep existing modules without the need to re-implement them. It could be quite helpful when it is needed to use a rare library, legacy code, or API that have implementations only for Java.
Why Scala?
To sum it up, Scala is well designed and very extensible. It has special processes (SIP and SLIP) that let any Scala developer propose enhancements. In conjunction with the large community, Scala ecosystem has been growing rapidly. Scala has its own stack of tools and is compatible with existing Java code. It brings new effective approaches that give the programmer an ability to do their job more efficiently. All these features make Scala one of the most attractive modern programming languages.
Contact us at contact@dsr-company.com to learn more or if you have a Scala project to discuss.