Getting Started with Scala

What is Scala?

From the Scala documentation:

  • Scala is an acronym for “Scalable Language”.
  • Scala is a pure-bred object-oriented language. Conceptually, every value is an object and every operation is a method-call. The language supports advanced component architectures through classes and traits.
  • Scala runs on the JVM. Java and Scala classes can be freely mixed, no matter whether they reside in different projects or in the same.
  • Read more here
  • SBT is the Scala Build Tool - More info here

Installation

  1. Install Scala $ brew install scala

  2. Install SBT $ brew install sbt

  3. Install Scala Plugin

    • IntelliJ IDEA - More info here
      1. Go to: IntelliJ IDEA menu => Preferences => Plugins => Install JetBrains Plugin => Scala => Install
  4. Create a project to start practicing and learning! You can follow the Maven Standard Directory Layout to structure your project (i.e. src/main/scala … src/test/scala).

    • Or you can also create directly a Scala Project in IntelliJ IDEA - Read here
  5. Write some code!

    • If you are a Java Programmer, this tutorial might look good to you!
    • Otherwise, look here
    • Here are the examples I wrote following the tutorial above.

References