Advantages of Scala, the Programming Language

Bright blue futuristic globe with digital data and computer coding
Oliver Burston/Ikon Images/Getty Images

New technology trends always include cycles of attention paid to new programming languages. One language that seems poised to capture some more attention is Scala. Though not popular yet, Scala seems to be gaining some ground by providing a happy medium between the approachable syntax of Ruby and the robust enterprise support of Java. Here are a few reasons why Scala might be worth a second look.

It Runs on the Java Virtual Machine

The reality of programming for an enterprise is that Java is a popular de facto language. Further, many larger enterprises will be risk averse with respect to overhauling an entire programming stack. Scala may provide a comfortable middle ground here, as it still operates on the JVM. This can allow Scala to play nicely with many of the operational tooling and monitoring pieces that may already be in place for a business, making a migration a far less risky proposition.

Scala also has a far greater potential for interoperability between itself and existing Java code. While many may purport this to be seamless, the reality is a bit more complicated. Despite these issues, it can reliably be said that Scala will likely play nicer with Java than many other languages.

The use of the JVM by Scala can also help to relieve any performance anxiety people may feel in migrating. It generally performs on par with an equivalent Java program, so generally, enterprise software shouldn't be stung by a switch to Scala.

Scala allows for use of most JVM libraries, that often become deeply embedded in enterprise code. In this way, Scala can be a good hedge for the current Java-soaked business.

More Concise and Readable Than Java

Scala shares many of the simple, readable syntax features of popular languages like Ruby. This is a feature that is sorely lacking in Java and has untold impact on the workload of a development team in code maintenance. The additional work required to understand and maintain existing Java code is a significant expense.

Additionally, the conciseness of Scala has a number of benefits. Scala can often be written in a fraction of the number of lines required to write an equivalent function in Java. This has a productivity benefit in allowing developers to do more functional work in a given workday. Fewer lines of code make for easier testing, code review, and debugging.

Functional Features

Scala makes use of a lot of functional syntactic sugar that has become popular with developers and makes many developers characterize Scala as a more functional language. One example is pattern matching, allowing for easy string comparisons. Another example is mixins, which allows functions to be included as part of a class definition, which can save a lot of time by reusing code. Features like these are often attractive to developers, particularly if they have become accustomed to their use in other non-Java environments.

Easy to Learn and "Exciting"

Scala's resemblance to currently popular languages like Ruby can be seen as an advantage, as its accessible syntax makes it relatively easy to learn, particularly when compared to more convoluted languages like Java and C++. The novelty and accessibility of the language have made it a popular choice with a small, energized group of developers.

This "excitement" shouldn't be underestimated, in fact, it may be the biggest advantage of a move to Scala. The reliability and age of Java make it a popular choice for the enterprise, but also attract developers of a specific, somewhat risk-averse mindset. Languages like Scala can often attract highly energized developers that are "language enthusiasts." These developers are often flexible, willing to try new things, innovative and highly skilled. For many organizations, this could be just what is needed on a tech team.

Whether or not Scala will see a surge in popularity remains to be seen, as with any language it has its evangelists and detractors. The reality is that a decision to move to Scala is an individual one, and heavily dependent on the environment.