Why You Should Learn Scala ? – Scala Introduction


1. Objective of Scala Introduction

This Scala Introduction tutorial will help you in understanding basics of Scala programming language. You will learn about Introduction to Scala, History of Scala, Scala features, why scala is popular and preferred over other programming languages, differences between Java and Scala and best books to master Scala language.

Scala Introduction Tutorial

2. Scala Programming Introduction

Scala is comparatively new to the programming scene, but has become popular very quickly. Below statements by big names show the Scala popularity in the industry:

  • If I had to select a language to use other than Java, it would be Scala. – James Gosling, creator of Java
  • If I would have seen ‘Programming in Scala’ book back in 2003, I’d probably have never created Groovy – James Strachan, creator of Groovy
  • None other than Scala can be seen as being ‘replacement of Java’ , and the momentum behind Scala is now unquestionable – Charles Nutter , co-creator of JRuby

Scala is a general purpose language that combines concepts of object-oriented and functional programming languages. It was developed to overcome the problems faced by other languages and can easily be integrated into existing code.

3. Video Tutorial

4. Scala History

Scala was first conceived in 2001 at École Polytechnique Fédérale de Lausanne by Martin Odersky, who was co-creator of Generic Java, javac, and EPFL’s Funnel programming language. First public release of Scala came in 2004 which was followed by version 2.0 in March 2006. In 2012 it was awarded the winner of the ScriptBowl contest at the JavaOne conference.

5. Scala Features

Some of the key characteristics of Scala include:

  • It is an object-oriented language that supports many traditional design patterns being inherited from existing  programming languages.
  • It supports functional programming that enables it to handle concurrency and distributed programming at fundamental level.
  • Scala is designed to run on JVM platform that helps in directly using Java libraries and other feature rich APIs.
  • Scala is statically typed that prevents it from problems of dynamically typing.
  • Scala is easy to be implemented into existing java projects as Scala libraries can be used within Java code.
  • There is no need to declare variables in Scala as Scala compiler can infer most types of variables.
  • Multiple traits can be designated for a class and then their interface and behaviour can be combined.
  • It supports first-class objects and anonymous functions.

6. Why Scala Is Popular

One of the key reasons for Scala’s success is its close integration with Java. Scala source code is designed in a manner that its compiler can interpret Java classes, and can fully utilize Java libraries, frameworks, and tools. After compilation, Scala programs can run on Java virtual machines and Android. For web-based development projects, Scala can even be compiled to JavaScript.

However, Scala is far beyond an alternative to Java. It is a more concise language that utilizes simple, easy-to-read syntax, and requires just a fraction of the lines of code when compared to a typical Java program. This makes Scala coding faster and provides easier testing.

Due to the above reasons, companies like Linkedin, Twitter, Coursera, Foursquare etc have ported majority of their code bases to Scala. Many open source projects like Apache Spark, Apache Kafka etc use Scala for their Core. The famous Play framework is also developed using Scala.

7. Prerequisites to learn Scala

Scala Programming is based on Java, so if you have knowledge of Java syntax, then it’s pretty easy to learn Scala. But if you do not know Java but are aware of any other programming language like C, C++ or Python then also you can learn Scala very quickly.

8. Scala Vs Java

Scala has set of features that make it completely different from Java language. Refer Guide for Comparison between Java and Scala to learn about the differences in Scala and Java language to understand how Scala is different from Java.

9. Books to learn Scala

There are not as many books on Scala as compared to Java or C, but there are still few books to get you started, regardless of your previous programming experience.

Refer this Comprehensive Guide for Scala books.

10. Summary

If you’re new to programming, or looking for a fast, modern language that is a combination of object-oriented and functional programming, Scala must be your choice that is definitely a language worth learning.

References:

http://www.scala-lang.org/

 

Leave a comment

Your email address will not be published. Required fields are marked *