Developers
August 28, 2020

What Does a Scala Developer Do?

Scala is an alternative to Java, with pros and cons all its own.

In the world of Java programming, three names get thrown around constantly: Kotlin, Scala and, of course, Java.

While Java is obviously the most well-known of the three, Scala has been gaining in popularity. What’s more, among top development languages, Scala rivals Perl for the top-paying jobs, offering roughly 50% greater pay than Java.

What is Scala? Why is it becoming so popular? How does it compare to Java?

Scala’s History

Scala was created by Martin Odersky. He began work in 2001 at the École Polytechnique Fédérale de Lausanne in Lausanne, Switzerland.

From the very beginning, many of Scala’s features were designed specifically to address issues with Java. By 2004, Odersky released the language publicly and it has continued to gain support since. In 2011 Scala’s developers won a research grant that helped fund continued progress. That same year, they formed the company that eventually became Lightbend, one of the primary maintainers of the language.

Java Interoperability

One of the biggest advantages of Scala is its interoperability with Java. Java has been one of the most popular programming languages for years, largely thanks to its cross-platform nature.

While many compiled programming languages—where code is compiled into a standalone application—target a specific platform through application programming interfaces (API) and frameworks, Java compiles for the Java Virtual Machine (JVM). In other words, the Java source code is compiled into JVM bytecode rather than native machine code. The bytecode is then run by the JVM. Therefore, whatever platform the JVM has been ported to can run Java software.

Although Scala was designed to improve on Java’s shortcomings, it was not designed to replace the entire Java ecosystem. As a result, from the beginning, it was designed to run on the JVM, just like Java, while offering a superior programming experience than Java itself.

This interoperability means that Scala and Java are completely compatible. Libraries written in either language can be used by the other natively. This has been a tremendous boost to Scala’s popularity, as it has made it easy for Java developers to onboard.

Pros and Cons of Scala

One of the biggest advantages of Scala is its complexity. Scala is one of the more complex languages available. Especially compared to Java, the learning curve can be difficult for newer developers. While, on the surface, that may seem like a bad thing, it also means the language has the ability to be extremely powerful and achieve great things.

One of these things is scalability. Even Scala’s name is a combination of scalable and language, indicating that scalability is a key component.

Another benefit of Scala is its code structure. Compared to Java, Scala’s code is far more concise. This makes it both more readable, and less prone to errors.

Scala’s defining trait, however, is that it provides both object-oriented and functional programming paradigms. Functional programming treats functions as first-class citizens. As a result, functional programming eschews some of the standbys in traditional languages and makes many tasks cleaner and safer. Functional languages generally don’t rely on recursion, such as ‘If…Then’ loops.

Functional programming also relies on the principle of immutable data structures. For example, a programmer wanting to edit the data in an array would create an all new array with the correct data, rather than edit the original one. Functional programming languages also tend to be stateless, making them ideal for concurrency. True to form, Scala offers better concurrency than Java and many other languages, as well as built-in parallel programming.

What Is Scala Used For?

Because Scala is a general-purpose programming language, there’s no limit to what it can be used for. Thanks to its interoperability with Java, it’s an ideal option for developing and deploying apps to the JVM, including desktop apps.

Because of Android’s roots, Scala is becoming one of the most popular options for Android development, along with Java and Kotlin. In fact, thoughtbot’s Mike Burns described the benefits of using Scala for Android development as far back as 2011:

”Scala can be thought of as a better Java. To start with, you don’t need as many semicolons. But Scala gives you the power of modern abstractions. Traits, implicits, type-checked null, blocks–everything you really need to get some solid coding done.”

Thanks to the Scala.js compiler, developers can compile their code to JavaScript, making it possible to create web applications with Scala. Scala.js is compatible with React and AngularJS, adding to its power and ability.

A Bright Future Ahead

There is no doubt Scala has a bright future ahead. It is a powerful language, featuring both object-oriented and functional paradigms, that builds on Java’s strengths and works to address its weaknesses.

Unlike other languages, such as Kotlin, Scala isn’t afraid to take a radically different approach, rather than being overly focused on being like Java. The end result is a language that has more potential to grow beyond Java’s limitations, rather than be artificially held back by them in an effort to maintain similarity.

Developers looking to round out their toolbox would do well to learn Scala. Even if a developer doesn’t choose to follow a career path in Scala development, learning how to use it, and the paradigms it embraces will help round out any developer’s skillset.

TagsScalaJavaProgrammingJavaScriptScala.jsKotlin
Matt Milano
Technical Writer
Matt is a tech journalist and writer with a background in web and software development.

Related Articles

Back
DevelopersAugust 28, 2020
What Does a Scala Developer Do?
Scala is an alternative to Java, with pros and cons all its own.

In the world of Java programming, three names get thrown around constantly: Kotlin, Scala and, of course, Java.

While Java is obviously the most well-known of the three, Scala has been gaining in popularity. What’s more, among top development languages, Scala rivals Perl for the top-paying jobs, offering roughly 50% greater pay than Java.

What is Scala? Why is it becoming so popular? How does it compare to Java?

Scala’s History

Scala was created by Martin Odersky. He began work in 2001 at the École Polytechnique Fédérale de Lausanne in Lausanne, Switzerland.

From the very beginning, many of Scala’s features were designed specifically to address issues with Java. By 2004, Odersky released the language publicly and it has continued to gain support since. In 2011 Scala’s developers won a research grant that helped fund continued progress. That same year, they formed the company that eventually became Lightbend, one of the primary maintainers of the language.

Java Interoperability

One of the biggest advantages of Scala is its interoperability with Java. Java has been one of the most popular programming languages for years, largely thanks to its cross-platform nature.

While many compiled programming languages—where code is compiled into a standalone application—target a specific platform through application programming interfaces (API) and frameworks, Java compiles for the Java Virtual Machine (JVM). In other words, the Java source code is compiled into JVM bytecode rather than native machine code. The bytecode is then run by the JVM. Therefore, whatever platform the JVM has been ported to can run Java software.

Although Scala was designed to improve on Java’s shortcomings, it was not designed to replace the entire Java ecosystem. As a result, from the beginning, it was designed to run on the JVM, just like Java, while offering a superior programming experience than Java itself.

This interoperability means that Scala and Java are completely compatible. Libraries written in either language can be used by the other natively. This has been a tremendous boost to Scala’s popularity, as it has made it easy for Java developers to onboard.

Pros and Cons of Scala

One of the biggest advantages of Scala is its complexity. Scala is one of the more complex languages available. Especially compared to Java, the learning curve can be difficult for newer developers. While, on the surface, that may seem like a bad thing, it also means the language has the ability to be extremely powerful and achieve great things.

One of these things is scalability. Even Scala’s name is a combination of scalable and language, indicating that scalability is a key component.

Another benefit of Scala is its code structure. Compared to Java, Scala’s code is far more concise. This makes it both more readable, and less prone to errors.

Scala’s defining trait, however, is that it provides both object-oriented and functional programming paradigms. Functional programming treats functions as first-class citizens. As a result, functional programming eschews some of the standbys in traditional languages and makes many tasks cleaner and safer. Functional languages generally don’t rely on recursion, such as ‘If…Then’ loops.

Functional programming also relies on the principle of immutable data structures. For example, a programmer wanting to edit the data in an array would create an all new array with the correct data, rather than edit the original one. Functional programming languages also tend to be stateless, making them ideal for concurrency. True to form, Scala offers better concurrency than Java and many other languages, as well as built-in parallel programming.

What Is Scala Used For?

Because Scala is a general-purpose programming language, there’s no limit to what it can be used for. Thanks to its interoperability with Java, it’s an ideal option for developing and deploying apps to the JVM, including desktop apps.

Because of Android’s roots, Scala is becoming one of the most popular options for Android development, along with Java and Kotlin. In fact, thoughtbot’s Mike Burns described the benefits of using Scala for Android development as far back as 2011:

”Scala can be thought of as a better Java. To start with, you don’t need as many semicolons. But Scala gives you the power of modern abstractions. Traits, implicits, type-checked null, blocks–everything you really need to get some solid coding done.”

Thanks to the Scala.js compiler, developers can compile their code to JavaScript, making it possible to create web applications with Scala. Scala.js is compatible with React and AngularJS, adding to its power and ability.

A Bright Future Ahead

There is no doubt Scala has a bright future ahead. It is a powerful language, featuring both object-oriented and functional paradigms, that builds on Java’s strengths and works to address its weaknesses.

Unlike other languages, such as Kotlin, Scala isn’t afraid to take a radically different approach, rather than being overly focused on being like Java. The end result is a language that has more potential to grow beyond Java’s limitations, rather than be artificially held back by them in an effort to maintain similarity.

Developers looking to round out their toolbox would do well to learn Scala. Even if a developer doesn’t choose to follow a career path in Scala development, learning how to use it, and the paradigms it embraces will help round out any developer’s skillset.

Scala
Java
Programming
JavaScript
Scala.js
Kotlin
About the author
Matt Milano -Technical Writer
Matt is a tech journalist and writer with a background in web and software development.

Related Articles