4 Interview Questions for Scala Developers
What’s the difference between the following terms and types in Scala: ‘Nil,’ ‘Null,’ ‘None,’ ‘Nothing’?What is ‘Option’ and how is it used?Explain the difference between ‘concurrency’ and ‘parallelism,’ and name some constructs you can use in Scala to leverage both.Bonus Question: What is ‘Unit’ and ‘()’?
Scala DSLs:
short intro : http://www.scala-lang.org/old/node/1403
Using in Camel routes: http://camel.apache.org/scala-dsl.html
Good presentation, which describes Scala as more succinct than Java and therefore more appropriate: http://www.slideshare.net/indicthreads/using-scala-for-building-ds-ls-abhijit-sharma
scala vs java, performance and memory?
Scala makes it possible to use enormous amounts of memory without realizing it.
So basically, the memory usage is, at a primitive level, the same. But Scala's libraries have many powerful methods that let you create enormous numbers of (usually short-lived) objects very easily. The garbage collector is usually pretty good with that kind of garbage, but if you go in completely oblivious to what memory is being used, you'll probably run into trouble sooner in Scala than Java.
Note that the Computer Languages Benchmark Game Scala code is written in a rather Java-like style in order to get Java-like performance, and thus has Java-like memory usage. You can do this in Scala: if you write your code to look like high-performance Java code, it will be high-performance Scala code. (You may be able to write it in a more idiomatic Scala style and still get good performance, but it depends on the specifics.)
I should add that per amount of time spent programming, my Scala code is usually faster than my Java code since in Scala I can get the tedious not-performance-critical parts done with less effort, and spend more of my attention optimizing the algorithms and code for the performance-critical parts.
"Scala shines for data processing and machine learning" says @sinisa_lyh of Spotify: http://t.co/kwUQSo5jlM
#scala @ApacheSpark
— Lutz Hühnken (@lutzhuehnken) October 19, 2014
George Orwell’s six rules for Scala programmers http://t.co/Hho6qgCBDI by @PeterHilton
— Computer Science (@CompSciFact) August 18, 2014
No comments:
Post a Comment