Using Scala in the real world [closed] - scala

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.

Related

Dependency Injection (DI) in Scala with Play [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 6 years ago.
Improve this question
I know a few ways to use DI in Scala:
Cake pattern
Macwire
What approach is the most suitable for multi layer application with Play?
I incline to using of macwire in my app.
UPD
Solution which fitted for me:
solution of this problem was leveraging of Macwire lib, but you can combine it with another approaches like pure functional style with monads (like Reader monad)
at my job we use macwire for DI with play and it works smoothly. we used to use cake pattern, but we found that it had more boilerplate than the macwire approach, the compiler errors were harder to interpret, the concept was harder to teach, and cake often triggered full recompiles (whereas we experience much better incremental recompilation with macwire. don't quote me on this one, our switch occurred between 2.10 => 2.11, and i believe there were some improvements from that).
it's hard to answer your question fully though without more details about what you're looking for exactly. care to elaborate?

Type erasure: Rust vs 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 7 years ago.
Improve this question
I program in Scala. I'm fairly versed.
Now, Rust has caught my eye. It looks good. Like it might be another language I would like to have under my belt.
From time to time, when I want to go crazy with types and still have compile time safety, I run into problems, one of which is type erasure.
Is there much difference between the two? Would it be easier to implement this question in Rust? Does Rust have type erasure?
PS. I hope this question is not too vague. Just want to have an overview of the main difference when it comes to types and generics.
Scala is GC language and has JVM runtime so it can tap into JVM ecosystem (clojure, java, groovy, ...), Rust is well known for it's trademark ownership approach which gives a lot more safety guarantees at compile time.
Rest of the differences can be neglected I believe.

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

Should I use Scala or Java or Node.js? [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 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!

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.