Should I use Scala or Java or Node.js? [closed] - scala

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I read quite extensively about Scala programming language.So far, I understand the following concepts about Scala :
Runs on conventional JVM
Inter-operable with Java
Combination of OOP and functional programming concepts
Statically typed and extensible
Less code and do more paradigm
My requirement is quite simple. I have to code a business module which follows a set of predefined rules that should be loaded dynamically during runtime. For example, Company A has a set of business rules and company B has another set. When a different program accesses the business module API , it should load the rules of that particular company and respond to the service. The business module will involve DB access and few more web service calls internally and extensive xml parsing.
We need this module to be as much scalable as possible. I can use AOP concepts of JAVA , but it is only too complex. The code will not be maintainable in the future.
Is Scala a better option in this case ? I am even considering Node.js
Please let me know you thoughts!

Related

Why don't we see Reactive programming in all the web applications? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 months ago.
Improve this question
Reactive programming is a very useful way to increase the capacity of webservices because of non-blocking thread. I recently came to know about this programming paradigm and I want to use it for most of the applications I build. Despite being so efficient, I still see new applications being built in a blocking way. What are the reasons that reactive programming is not used everywhere as it's a nice paradigm and very efficient in handling users at scale?
I don't know if this question is too generic or suited for the platform. I tried searching on the internet and could not find any staisfactory information. Therefore, I am asking it here hoping foor someone experienced to help me with it. I am trying to learn Project Reactor for Reactive Spring.
Reactive, e.g, WebFlux, is to solve a specific problem that most websites won't experience. Regular servlet or dispatcher-based frameworks put each request on its own thread, which is generally fine. Soon Java will come with lightweight threads which is claimed to perform better than reactive anyway. Reactive is also based on function programming paradigm, which is a complicated and difficult way to write applications.
Reactive is meant to handle multiple requests on a single thread by using callbacks from I/O operations. If done correctly websites can handle more requests for the same number of threads than non-reactive. This would reduce resource costs and perhaps allow a service to be more responsive since starting regular threads is expensive.
In my experience, in practice, Reactor is not generally done correctly, has far more bugs due to the complexity of function programming, and takes much longer to deliver the code.
In my opinion, it can still be useful framework for simple services that are primarily I/O bound and have very little if any business logic. That is until lightweight threads become standard in the JDK and then maybe you have chosen the wrong path.
Also in my opinion, developers find it fun and exciting due to the functional programming paradigm, as do I. It's not a bad thing to use but shy away from it for important business related code/services.

Concurrency model: Erlang, Elixir, and Scala [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What is the difference between the concurrency models of Erlang, Elixir, and Scala?
This is way too hard to answer from a point of zero prior knowledge. I think the most valuable way to even approach it (because this sort of thing gets asked all the time in a most unhelpful sort of way) is to include some links to reference information about these -- and then close the question.
(If this is such a bad idea in the minds of other SO users that you think we should delete this entirely I'll create a resource page external to SO to use as a future reference-to-references.)
Erlang Process vs Java Thread
Is Scala's actors similar to Go's coroutines?
Future investment: Erlang vs. Scala
Seven Concurrency Models in Seven Weeks
Qt Concurrent (Qt documentation that explains a bit about how the underlying madness of shared memory concurrency is tamed somewhat within that framework)
An Introduction to Asynchronous Programming and Twisted
Parallelism and Concurrency (Haskell Wiki)
Why Events are a Bad Idea (USENIX paper -- good foundational information)
Wikipedia article on Concurrency
Why Microservices? (conceptually relevant, particularly since Erlang and other "actor systems" usually fit the conceptual definition of being swarms of microservices, whether distributed or not)
Concurrency: Time is of the Essence (SICP -- FYI: This entire text is probably one of the most important things you can read as a programmer)

Using Scala in the real world [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Question Context: Where there is an exiting Java application or a new project development that is to be written in mostly Java.
We know that we can use Scala from Java and vice versa.
What specific system features are more suited for functional programming. I mean I wouldn't use Scala just because it has a nice feature of executing a passed-in function implementation over the items of a collection nor would I use Scala just for its object orientation capabilities I would just use Java for that.
So going beyond the nice and interesting features of Scala what set of system features make a compelling case to use Scala on a Java project?
where to start, and where to end?
pattern matching
case classes
functions (and higher order ones)
great collections
more object oriented than java, avoid common anti-patterns
type inference -> much less noise
many great options in concurrency. Futures in Java are just so useless compared to Scala ones
traits for composing services
Testing with ScalaTest+ScalaCheck is much much better than JUnit/TestNG/
Akka !
The list is just too long.

how do i start learning shapeless concepts in scala [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I would like to learn about polytypic concepts in Scala, I came across shapeless library what would be the best starting point for learning and applying shapeless.
I don't know if thats an answer you wan't, but the best push for me to start learning/using shapeless was a couple of Miles videos from different Scala conferences :
From flatmap
ScalaNE 2012
ScalaNE 2013
His forgotten blog
And as a big practise - i'm writing a lot using Spray toolkit, it uses shapeless inside. So try to write some web server or some client.
Also a github's wiki contains good intro for the library.
Great idea - try to rewrite some case classes into shapeless records with hlists, it's pretty cool to use it with some JSON converter =). Much of it is some generic kind of stuff wich is not very useful in real project, but if you want better understanding of type level programming, it's really great stuff

Dissimilar Scala book in near future [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've seen quite a few books about Scala, but those are so similar to each other. Wonder what titles (related to Scala) would you like to see that would differ from "main stream"?
At this point, all Scala books are about teaching Scala. That's natural, as most readers won't be familiar with Scala.
As time passes, we'll likely need books with Scala Patterns (which can be very different from Java patterns) and anti-Patterns, coding tips, advanced algorithms, or topic-specific, like concurrency or strategic programming.
The Lift book kind of fits in the category of topic-specific, but it is really much more about the Lift library and Lift usage than about general Scala usage for web programming.
Another topic-specific book on the way is "actors in scala" - which was mentioned at the Scala BASE meetup - currently being authored (or co-authored at least) by Martin Odersky.
The actors framework offers a substantially new concurrency model (pioneered in Erlang) that aims to make writing concurrent code easier than traditional shared state concurrency, as well as offering better scalability for multi-core architectures.
One important thing we don't yet have is an entry-level book, suitable for Scala as a first language, rather than as a next step after Java, assuming some familiarity with the JVM APIs and the syntax of Java.
At the moment there is not a text on the language that I could really recommend to a bright youngster (late teens) who wants to start programming with something better than the Hobson's choice of Pascal available in the IT classes at school -- not that any of the other (quasi-)functional languages are in much better state.