Scala is very well mature enough to utilize it in production code now. Frameworks like play has direct support on Scala. Big players like LinkedIn, twitter, foursquare using it. About the java 8 vs Scala, IMO scala is miles ahead of java 8. See the following code:
Code:
package test;
public class Bean {
private int id;
private int age;
private String name;
private String address;
public Bean(int id, int age, String name, String address) {
this.id = id;
this.age = age;
this.name = name;
this.address = address;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public int hashCode() {
int hash = 7;
hash = 13 * hash + this.id;
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Bean other = (Bean) obj;
if (this.id != other.id) {
return false;
}
if (this.age != other.age) {
return false;
}
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.address == null) ? (other.address != null) : !this.address.equals(other.address)) {
return false;
}
return true;
}
@Override
public String toString() {
return "Bean{" + "id=" + id + ", age=" + age + ", name=" + name + ", address=" + address + '}';
}
}
Here is the Scala equivalent code:
Code:
case class Bean(id:Int, age:Int, name:String, address:String)
84 lines of java boilerplate code reduced to one line of scala code. Less code you write, less errors will pop up. Also Java has lot of confusing error prone language constructs that can easily fool you if you're not careful. I looked in to Clojure, but the code looks less readable and cryptic to me.