Hacker News new | past | comments | ask | show | jobs | submit login

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.

I 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.

"Production environment" is a very relative and subjective notion. We used Scala on the server-side for basically real-time bidding, with the servers receiving several thousands of requests per second per server instance, with a total of about 30,000 reqs per sec of real traffic coming in, to which we had to reply in a maximum of 100ms which included the network roundtrip. Without Scala, without the ease with which I could juggle with concurrency issues and asynchronous processing of streams, I couldn't have pulled it off. So in other words, Java is unfit for a production environment from my perspective.

> one of the biggest is IntelliJ's capability as Java IDE

That's a pretty shallow reason if you ask me, because the speed of writing code is not the point and IntelliJ IDEA 13 is also very, very good for Scala development.

> I just dislike Scala's monstrosity. I have high hopes for Kotlin

Well, there's your problem. You thought that Scala is something that it isn't, like a "better Java". If you approached it like that, without delving in its FP capabilities that Java 8, Kotlin, Ceylon, Groovy cannot match (or whatever "better Java" is the fad du jour), then of course it was a bad experience.

Next time you'll have some time to burn, start here: http://www.manning.com/bjarnason/

Just a quick comment: If I wanted to embrace functional programming, I would skip Scala and goto Haskell, ML, or Clojure. And if I cared, I should really dig deep into this subject (tool vs. language). Scala just doesn't fit my needs. btw. I've preordered that book awhile ago just for supporting it but not really interested in it.

Becoming professional, and gaining experience has given insight in helping to choose stack in respect to matureness, stability, tool support, documentation etc. It's not that you cannot write Scala code for production and be happy about it. But I rather not. Writing fast is only one part of it. IntelliJ supports the whole aspect of development cycle, and it's good to hear Scala plugin is catching up. Just my opinion.

> If I wanted to embrace functional programming, I would skip Scala and goto Haskell, ML, or Clojure.

Interesting choice of languages. Out of that list, only Haskell is suitable for the argument you're trying to make.

Is that SML or Ocaml? If that's SML, well it's a really poor choice. And what makes you think Clojure is better for functional programming? I'm not arguing that it isn't, it's just interesting seeing it in a list of what are supposed to be better choices for FP. Because in my opinion, Clojure is just as dirty as Scala or maybe even more so. And it's also a Lisp and the styles and patterns used tend to be different in Lisps, than what you do in Haskell or Scala.

That book I linked is not about Scala, but about FP and just happens to use Scala as the language. It's a good book. If you preordered it, it would be a waste to not read it.

What I meant is that if I needed to switch from Java to a language that is oriented towards functional style, I would not consider Scala -- not because it wouldn't be a good choice regarding FP (I'll leave arguing about how well a language is suited to FP for others) but because considering all it has to off, and how its promise was not fulfilled for me -- or maybe it was me what changed.

Well yeah, maybe you'll like Clojure better. Different style as I've said.

I'm playing with Haskell as well. Cool language, the ecosystem does suck a little.

Scala support in IntelliJ is superb. I maintain legacy Java code and newer Scala code in IntelliJ and the Scala plugin is excellent.

It's much, much better than it used to be but it is still not as good as the Java support. I write both in my day job and while I much prefer scala, anyone who feels that IntelliJ's scala support is equal to java is deluding themselves. At least a few times a day I come across something where I start shaking my fist at the IDE over something which would Just Work for java.

That said, it is improving and closing the gap rapidly.

Perhaps you're using more of the IDE features than I am. I spend most of my day in IntelliJ writing Scala code (and a bit less maintaining old Java code) and haven't spotted any major issues with the features that I use.

Scala tooling has improved hugely, just look at the Scala IDE and the IntelliJ Scala plugin now vs. 2 years ago.

The only area where I have ongoing issues with my IDE (Scala IDE) is with the play template plugin, can really wreak havoc in both template and controller layers with spurious errors that break mouse-hover type inference click-through-to-type functionality. Even here there's been a ton of improvement, 2 years ago in the template layer there was no semantic highlighting, no indication of _valid_ errors, and stack trace error lines pointed to lines in the generated template, not the .scala.html source file, fun times o_O

Recently switched to XML literals in place of Play's @ templates, not surprisingly the above issue has disappeared, and am now left with a fully functional IDE, code completion, refactoring, and the all the rest, pretty thrilled about the IDE story in Scala to be honest.

I +1 that, the tooling of Scala is comparable to what is available to Python and Ruby developers, given that building a proper IDE for such language is not a simple task, but right now Scala IDE (eclipse-based) and Intellij IDEA's support is more than satisfying to me.

> 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.

I'd rather experience 60s and 80s language (Lisp, ML/Haskell) than something like C or Java, even if I have to put up with a text editor.

I'd really much rather get both, I want AST editors in the spirit of paredit.

My point was about Interlisp, Smalltalk, Cedar and their respective environments.

A plain text editor cannot reproduce the live code experience from such environments.

If you're talking about tool availability and production readiness then I think Scala has the advantage over Kotlin. By the time Kotlin reaches a similar level of maturity, how many features will it have that haven't found their way into Java?

(I don't think Scala's a thousand-year language, but I think Kotlin drops too much of what makes it good; I'd look to the likes of Ermine as a potential future replacement. But more to the point, Scala is production-ready today - I know because I use it in production)

These 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.

I'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.

Good points, but one huge advantage of Java is much faster compile times and much more mature tooling.

I actually favor Clojure to Scala as a matter of personal choice, but Java has lots of valid use cases dealing with tooling and compatibility to existing systems.

I fully agree. IMHO scala has one problem: the compiler slowness. It is really a marvellously designed language.

sub projects + incremental builds on a warmed up JVM make for a very quick dev cycle.

Deploying is another matter, full builds lag far behind Java, something that will not be changing anytime soon, scalac is doing a ton of work under the hood.

Just to nitpick, Java has had type inference for static methods since Java 7.

Also local imports, and being able to treat any object as a module.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact