If your team is open to learning new things and comfortable with the occasional bout of feeling lost, then Scala is absolutely the better choice. The advantages of Scala is not it's lack of verbosity primarily, (Ceylon, Kotlin, F#, etc. are all similar in verbosity) but its support for functional programming. And I should add that 'lambdas' do not make a language functional, imho.
Scala's focus on immutability (case classes, std lib), monadic comprehension (for expressions), type class support etc. all make it a joy to be productive in. But it also has proper lambdas that just work right (Java8s lambdas are done poorly for sake of backwards compatibility).
You'll find less of a need to rely on frameworks (DI is trivial with just language features, you learn them once, you're good, no spring needed), you'll have less bugs, and it will be more fun!
Reasons not to use Scala would be the lack of tooling (you're IDE will annoy you more than if you pick java), your team may get frustrated at times and need to ask the mailing list or IRC channel for help, and new developers who don't have scala experience will need a bit more handholding.
We're finding for some cases we get a 100x LOC reduction coming from C#. This is not a joke, and it's not about us writing extra terse impossible to read scala and fitting too much on one line. The type system just allows us to reuse a few abstractions EVERYWHERE. We are getting insane code reuse, even between teams.
You mentioned fewer bugs, and indeed I feel that Scala is safer than Java (fewer bugs). Some reasons: 1) Scala has named parameters, so you can avoid bugs related to parameters placed in the wrong order (simply specify the parameter name, if you have more than one of the same type). And 2) when you code in Java, you'll have to read and write more code = higher bug risk. (But I wouldn't want to write super concise code in Scala, that could also mean higher bug risk.) And 3) Scala doesn't suffer from null pointer errors (assuming you use Option/Some/None). Java also has some Option class but I've gotten the impression that people tend not to use it.
Scala has the best collections package I've ever seen in any language so far.
Agreed. I'm using IntelliJ Community Edition with Scala plugin. It works really well. Only settings I've changed were setting the font to Source Code Pro and turning off spell checking.
I'm absolutely loving Scala right now. I was writing a lot of stuff in Go until I started a new project that needed to leverage some Java libs. I had been wanting to try Scala, so I went with it instead of Java (or Clojure, etc).
I liked Go for it's elegant concurrency, ease of deployment, and fast compiler, but Scala's type system and composition with for comprehensions is really nice.
Java interop is pretty seamless so far. Scala has nice primitives for wrapping null and exceptions in safer ways and eliminates a lot of ugly x != null checks everywhere.
Coming into it, I'd heard that Scala was hard to learn, but I didn't find that to be true. I was only vaguely familiar with pattern matching, monads, traits, ADTs, etc from playing with Rust, but I found plenty of good resources for learning Scala.
Comments
If your team is open to learning new things and comfortable with the occasional bout of feeling lost, then Scala is absolutely the better choice. The advantages of Scala is not it's lack of verbosity primarily, (Ceylon, Kotlin, F#, etc. are all similar in verbosity) but its support for functional programming. And I should add that 'lambdas' do not make a language functional, imho.
Scala's focus on immutability (case classes, std lib), monadic comprehension (for expressions), type class support etc. all make it a joy to be productive in. But it also has proper lambdas that just work right (Java8s lambdas are done poorly for sake of backwards compatibility).
You'll find less of a need to rely on frameworks (DI is trivial with just language features, you learn them once, you're good, no spring needed), you'll have less bugs, and it will be more fun!
Reasons not to use Scala would be the lack of tooling (you're IDE will annoy you more than if you pick java), your team may get frustrated at times and need to ask the mailing list or IRC channel for help, and new developers who don't have scala experience will need a bit more handholding.
We're finding for some cases we get a 100x LOC reduction coming from C#. This is not a joke, and it's not about us writing extra terse impossible to read scala and fitting too much on one line. The type system just allows us to reuse a few abstractions EVERYWHERE. We are getting insane code reuse, even between teams.
You mentioned fewer bugs, and indeed I feel that Scala is safer than Java (fewer bugs). Some reasons: 1) Scala has named parameters, so you can avoid bugs related to parameters placed in the wrong order (simply specify the parameter name, if you have more than one of the same type). And 2) when you code in Java, you'll have to read and write more code = higher bug risk. (But I wouldn't want to write super concise code in Scala, that could also mean higher bug risk.) And 3) Scala doesn't suffer from null pointer errors (assuming you use Option/Some/None). Java also has some Option class but I've gotten the impression that people tend not to use it.
Scala has the best collections package I've ever seen in any language so far.
I code Scala in IntelliJ and it's an absolute pleasure :-)
Agreed. I'm using IntelliJ Community Edition with Scala plugin. It works really well. Only settings I've changed were setting the font to Source Code Pro and turning off spell checking.
I'm absolutely loving Scala right now. I was writing a lot of stuff in Go until I started a new project that needed to leverage some Java libs. I had been wanting to try Scala, so I went with it instead of Java (or Clojure, etc).
I liked Go for it's elegant concurrency, ease of deployment, and fast compiler, but Scala's type system and composition with for comprehensions is really nice.
Java interop is pretty seamless so far. Scala has nice primitives for wrapping null and exceptions in safer ways and eliminates a lot of ugly x != null checks everywhere.
Coming into it, I'd heard that Scala was hard to learn, but I didn't find that to be true. I was only vaguely familiar with pattern matching, monads, traits, ADTs, etc from playing with Rust, but I found plenty of good resources for learning Scala.
I really found this series of blog posts to be helpful: http://danielwestheide.com/scala/neophytes.html