• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java 8 vs Scala

 
Will Myers
Ranch Hand
Posts: 381
Java jQuery Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no
 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
Hauke Ingmar Schmidt
Rancher
Posts: 436
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
7
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic