Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Are The Benefits Of Scala? [closed]

Tags:

java

scala

I am a Java developer and I want to know how I can use Scala in my Java programs?

like image 934
Radi Avatar asked Aug 28 '09 08:08

Radi


People also ask

What is the use of closures in Scala?

A closure is a function, whose return value depends on the value of one or more variables declared outside this function. The following piece of code with anonymous function. There are two free variables in multiplier: i and factor.

What are the benefits of Scala?

The Advantages of ScalaScala has an exact syntax, eliminating boilerplate code. Programs written in Scala require less code than similar programs written in Java. It is both an object-oriented language and a functional language. This combination makes Scala the right choice for web development.

Why closures are useful?

Closures are useful because they let you associate data (the lexical environment) with a function that operates on that data. This has obvious parallels to object-oriented programming, where objects allow you to associate data (the object's properties) with one or more methods.

What is the main drawback of Scala language?

a. However, the Scala presentation compiler may unusually be slow to load an auto-complete list working with a relatively large project. This is because they rewrote the compiler to integrate with their platform.


1 Answers

Go read Daniel Spiewak's excellent blog series about Scala. With Scala you can keep:

  • all your Java libraries
  • all the advantages of running on a JVM (ubiquity, administrative tools, profiling, garbage collection etc)

But you can write Scala code:

  • more concise and clear than Java (especially using more functional style, such as in the collections library)
  • it has closures and functions as part of the language
  • it has operator overloading (from the perspective of usage)
  • it has mixins (i.e. interfaces which contain implementation)
like image 98
oxbow_lakes Avatar answered Sep 17 '22 19:09

oxbow_lakes