“Thinking in Scala" if I have a Java/C++ background?
I'm familiar with developing server-side applications in Java, but now I'd like to start using Scala. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer:
I'm not looking for a detailed comparison between Java and Scala.
The key difference between Scala and Java is Scala's use of functional programming.
var
, when you can do it with a val
. Loops will mostly be replaced with higher order constructs like map
and fold
. Avoid nulls, and use Option
s instead. Learning wise, I would start with Twitter Scala school, then once you grok that, I recommend the book Functional Programming in Scala. I think these two resources will guide you in the FP direction, as opposed to writing Java-style programs with new syntax. Then, find the right spot in the OOP/FP scale that suits the problem at hand.
链接地址: http://www.djcxy.com/p/538.html