Overview of Scala Programming Language

Pioneered by Swiss computer scientist and programmer Martin Odersky, Scala is a general-purpose programming language that boasts a strong static type. It was designed to satisfy many of the shortcomings of Java, supporting interchangeable libraries between the two languages.

Scala is short for “Scalable Language,” meaning the language grows to accommodate the needs of the user. Scala can be used to create single-line expressions, or it can be used to develop massive applications and infrastructures for companies like Twitter. This versatility makes it an incredibly powerful language that rivals other, more widely known languages.

Characteristics of Scala

One of the defining characteristics of Scala is its object-oriented focus. In Scala, values are objects and operations are method-calls. It also supports component architecture using classes and traits.

As explained on the official Scala website, the syntax is simple and east to understand, yet it’s still a complete, functional language that contains all of the necessary elements for creating complex apps, including a library with data structures, first-class functions and preference of immutability over mutation. An area in which Scala truly shines, however, is it’s ability to grow and expand. Scala is considered a “future-proof” language for this very reason, reducing common problems associated with transitioning to different languages. Regardless of the size of your project, Scala can handle it.

Being that Scala was designed to satisfy the shortcomings of Java, it should come as little-to-no surprise to learn that Scala runs on Java Virtual Machines (JVM). JVMs view Scala and Java as the same language, with the only difference being a single additional runtime library (scala-library.jar).

Scala vs Java

Although Scala supports the use of Java libraries, and vise-versa, there are some stark differences between the two languages. Scala, for instance, does not require the use of a semicolon to end a statement. The first letter of a Scala value type is also capitalized, while Java value types remain lowercase. Other differences between the two languages include the use of “def” when preceeding methods; the use of “val” when preceding local or class variables; and different important commands (Scala uses “import foo._.” while Java uses “import foo.*”)

Scala is used in a number of different applications, some of which include the following:

  • Finance projects by Morgan Stanley
  • Physical gold-based savings service BitGold
  • LinkedIn’s Signal API
  • Apache Spark
  • Foursquare app
  • Twitter
  • Audio distribution platform Soundcloud
  • HuffingtonPost’s content delivery system Athena

Hello World!

Here’s an example of the Scala being used to create a basic “hello world” message:

 object HelloWorld extends App {
   println("Hello, World!")

Thanks for reading, follow your passion by finding the perfect course, just for you over on www.stoneriverelearning.com.

Online Technology Courses Stone River eLearning