Scala and Akka supports distributed and concurrent application. Even JavaThread supports same. Why do we need functional programming instead of object oriented programming ? Why do we need another framework/toolkit akka ?
I think the argument boils down to a few key points:
Concurrency is intrinsically difficult.
Concurrency with threads is really difficult.
More distributed systems and multi-core processors mean we need to be able to support more concurrency.
The growth of big data applications also demands more effective use of concurrency to cope with all that extra processing (you can't do everything in Hadoop).
We need to make concurrency simpler in order to build robust, scalable, maintainable systems.
Akka offers a way to achieve this.
Actor systems like Akka are based on asynchronous message passing and immutable state, providing a higher level of abstraction than threads, which effectively allow you as a developer to think about the actual problem you're trying to solve, without having to worry about all the details of the plumbing. I've only just started looking at Akka myself, but already it's pretty clear that Akka provides a much simpler, cleaner and more robust approach to concurrency than anything I could come up with based on threads. Of course, I'm not much of a threads programmer anyway, but then the whole point of Akka is that grunts like me don't have to be threads gurus to work productively on concurrent systems. Which sounds good to me.
But why not try it out for yourself? A good place to start is Derek Wyatt's excellent book Akka Concurrency. Incidentally, Akka is also available for Java, although my understanding is that certain features of Akka (specifically based on Scala's support for functional programming) are not available in the Java version.
No more Blub for me, thank you, Vicar.
posted 6 years ago
Seems few of the Java 8's features similar to Scala like Lambda expression, etc... Seems future java releases may include the features similar to Scala and we may not prefer Scala. Any thoughts ?
Well, that's a different question, isn't it? Why Scala
As for future Java additions like lambdas etc, if my project needs this kind of thing right now, and I'm not tied to Java already (e.g. by legacy code), then why wait for Java 8 (or 9 or 10...) if I can do what I want with Scala now? If you really need functional programming constructs, then you might be better choosing a language that has these things baked in, not bolted on. And Scala is not the only option for FP on the JVM - you could try Clojure for example.
But it will depend on your project, skills, working culture etc etc. Scala might be a great choice for some projects/teams, but not for others. I don't think there is a simple yes/no answer - you need to pick the best tool for a specific job.
PS There's a few links to talks on this topic in this thread.