5 ms·
As a Scala and Java developer, I am not even slightly tempted to replace Scala as my main language for my next project with Java 8. If I'm forced to write Java,
by eranation 13y ago
As a Scala and Java developer, I am not even slightly tempted to replace Scala as my main language for my next project with Java 8. If I'm forced to write Java, it might better be Java 8, but if I have a choice, there are so many things (as the OP correctly states) that make Scala compelling for me beyond Lambdas that just adding that feature to Java doesn't really mean anything to me. Ruby has Lambdas, so does Python and JavaScript, Dart and I'm sure any other modern language. I like Scala because of so many other things other than lambdas that a single comment is not enough.
But to name a few (some were referenced by the OP)
Everything is an expression, For comprehensions (especially with multiple futures, resolving the callback triangle of death in a beautiful syntax IMHO), Implicit conversions, Case classes, Pattern Matching, Tuples, The fact that everything has equals and hashcode already correctly implemented (so I can put a tuple, or even an Array as a key in a map), string interpolation, multiline string, default parameters, named parameters, built in dependency injection, most complex yet most powerful type system in any language I know of, type inference (not as good as Haskell, but better than the non existent in Java). The fact I always get the right type returned from a set of "monadic" actions thanks to infamous things like CanBuildFrom (which are pure genius). Let's not forget pass by name arguments and the ability to construct a DSL. Extractors (via pattern matching). And many more.
I think Scala is here to stay, at least for Scala developers, I am 100% sure you will not find a single Scala developer that will say: "Java 8 got lambdas? great, goodbye scala forever!". Only reason I can think of is compile time and binary compatibility. If we ignore those two, all I can say is that this just proves how Scala is in the right direction (since Java 8 lambdas and default interface methods and steams are so clearly influenced)
I do wish however that Scala will improve Java 8 interoperability, e.g. support functional interfaces the same way. and add new implicit conversions to Java 8 collections as well as take advantage to improvements in the JVM.
I will replace Scala as soon as I find a language that gives me what Scala does and does it better. So far I didn't find such a language (examined Haskell, Clojure, Go, Kotlin, Ceylon, Dart, TypeScript, Rust, Julia, D and Nimrod, Ruby Python, JavaScript and C#, some of them were very promising but since I need a JVM language, and preferably a statically typed one, it narrowed down the choices pretty quickly)
Java 8 is by far not even close, sorry. Great improvement, I'm very happy for Java developers that will get "permission" to use it (might be easier to adopt than Scala in an enterprise) but this is not a reason for a Scala shop to consider moving back to Java.
- justinsb 13y agoThese are all great reasons to stick with Scala. However, to survive Scala must also attract new developers; I think a better Java will lessen that influx.
- virtualwhys 13y agoI'd say the bigger threats to Scala in terms of adoption are potentially Kotlin (and the strong JetBrains tooling that will inevitably come with it), typed Clojure, and Haskell. Otherwise, Java 8 is not a game changer for the simple fact that the enterprise moves at a snail's pace in terms of adoption. Teams with the flexibility to switch from pre-Java 8 to Java 8 will likely also have the freedom to choose an alternate JVM language, or perhaps even Haskell if they're not tied to the JVM.
- mushishi 13y agoI would use Java 7 rather than Scala in production environment. There are different reasons, some actually concern language features but one of the biggest is IntelliJ's capability as Java IDE. It blows away all of the other alternatives as efficient way of creating readable code that is breeze to refactor. Even though Java lacks features that make life easier, the lack of features is important, too. And as a former Scala enthusiast (when it was not so hot), I just dislike Scala's monstrosity. I have high hopes for Kotlin because it has some advanced stuff that have been clearly included by the experience of using Scala. And it in all likelihood will have very good IntelliJ interop, because JetBrains. I don't get it why people fuzz over languages without a context of tools.
- pjmlp 13y ago> I don't get it why people fuzz over languages without a context of tools. Because many rather stay in 1970 era of PDP11 command line and text editors and never experienced with the 1960 ideas implemented in Xerox PARC 1970 languages and 1980 GUI environments.
- lucian1900 13y ago