aspose file tools*
The moose likes Features new in Java 8 and the fly likes Java 8 vs Scala Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Features new in Java 8
Bookmark "Java 8 vs Scala" Watch "Java 8 vs Scala" New topic
Author

Java 8 vs Scala

Will Myers
Ranch Hand

Joined: Aug 05, 2009
Posts: 328

Do you think Java can catch up with Scala in terms of functional programming? Are lambdas enough to stop developers deserting Java for other jvm languages?
Andreas Scheucher
Greenhorn

Joined: Oct 19, 2010
Posts: 10
no
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Care to elaborate on that "no"? Because I could say "yes" and it would be just as meaningless. (I'm not saying yes or no, I haven't even given this any thought.)


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Hauke Ingmar Schmidt
Rancher

Joined: Nov 18, 2008
Posts: 433
    
    2
Will Myers wrote:Are lambdas enough to stop developers deserting Java for other jvm languages?


Are they in significant numbers (not in loudness by the ones gone)? Is that the (a) problem Java 8 wants to solve? (That are real, non rhetoric questions.)
Andreas Scheucher
Greenhorn

Joined: Oct 19, 2010
Posts: 10
Sorry, for my sloppy answer. But I could not resist.

I do not have the numbers, how many Java developers left for other languages. And actually, I am not really interested in them.
Can only speak for myself. If I can choose, I prefere Scala over Java in meantime. I produce code, which is less error prone, then in Java. Mainly because of the usage of immutable data.
Richard Warburton
Author
Greenhorn

Joined: Jun 16, 2013
Posts: 22
    
    7
Will Myers wrote:Do you think Java can catch up with Scala in terms of functional programming? Are lambdas enough to stop developers deserting Java for other jvm languages?


Hi Will,

Thanks for your question - I guess it depends on what you mean by "catch up". Scala has a lot of language features that Java doesn't have.

Some of those features are useful and help reduce boilerplate within common programming patterns or make it easier to "do the right thing". The obvious example to me here is case classes. A basic value type with fields, value equality, value-based hashcode etc. is a common thing to want in programming. Its something that would help probably help Java programmers and when I speak to developers about Scala it is something that seems almost universally popular. At the library level the immutable collections of Scala are a nice addition as well. On the other hand Scala adds a lot of baggage and complexity and slow compile times etc.

So I don't think the right mentality for Java's evolution is to view Scala as being the future and try to catch up. I think the right answer is to view it as a large scale experiment in language design. There's some good ideas, there are some failures. The good ideas should be rapidly adopted and the failures avoided.

Some developers are definitely moving on from Java to other languages and some new developers are always arriving into the Java ecosystem. So I'm not that personally that worried about whether a specific feature can improve Java's popularity or not. I don't think lambda expressions are enough on their own. I think the best way to maintain Java's popularity as a development environment is to continue to invest in and evolve the language, core libraries and the JVM. Lambdas/Streams/Collectors are a great addition but they shouldn't be considered the end of the line for Java's evolution - just the latest step.

thanks,

Richard
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java 8 vs Scala