Git Product home page Git Product logo

scala-explained's Introduction

Scala explained

Scala is a programming language that let you write cool stuff like:

def sing(i: Int) = s"Happy Birthday ${ if (i == 3) "dear Tom" else "to You" }"
(1 to 4).map(sing).foreach(println)
/* -->
Happy Birthday to You
Happy Birthday to You
Happy Birthday dear Tom
Happy Birthday to You
*/

This website explains Scala features that will help you understand Scala programming. Each explanation is illustrated by a code snippet that can be copy-pasted into a Scala interpreter.

Talking about a Scala interpreter, here's how you can set up Scala programming tools:

Setup Scala environment

  1. Install Scala from the official website: https://www.scala-lang.org/download/

  2. Create a Scala source code file named MyScalaProgram.scala with the following content:

object MyScalaProgram {
  // the `main` method is the program entry point
  def main(args: Array[String]): Unit =
    println("I was here.")
}
  1. Compile and run your Scala program using your favorite Scala environment (IntelliJ, sbt) or through a terminal:
scala MyScalaProgram.scala
# --> I was here.

Start!

First of all, we will talk about Scala basic syntax.

If you are already familiar with Scala, you can learn more about Scala cool functional programming (FP) features here.

If you want to build beautiful software architectures, you can take a look at Scala mind blowing object concepts.

For the most curious among you, there is also an exhaustive list of Scala keywords and symbols with plenty of examples.

Enjoy.

scala-explained's People

Contributors

yoeo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.