This document summarizes some of the good parts of the Scala language based on feedback from Java developers who have used Scala. It highlights features like type inference, expression syntax everywhere, case classes, pattern matching, functions, the ecosystem including REPL, libraries, frameworks and tools, concurrency with actors, and the strengths of the type system. It also provides some warnings about using features like implicits and annotations wisely.
9. var retVal = for{
a <- numList if a != 3; if a < 8
}yield a
for( a <- retVal){
println( "Value of a: " + a );
}
val delimiter = if(defaultDelimiter)’;’ else ‘-’;
Noreturn any more!
54. what a route looks like
[Http Method] [path] [controller method]
GET / controllers.Application.main
POST / controllers.Application.index
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
GET /webjars/*file controllers.WebJarAssets.at(file)
61. You know Scala Collections well, you
play with Spark well ;)
val textFile = spark.textFile("hdfs://...")
val errors = textFile.filter(line => line.contains("ERROR"))
errors.count()
errors.filter(line => line.contains("MySQL")).count()
errors.filter(line => line.contains("MySQL")).collect()