Tips on Scala

Posted on Mar 24, 2016 in Computer Science

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

** Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives. **

Trick & Traps

General Tips

  1. IntelliJ IDEA is the recommended IDE. Eclipse (with the Scala IDE plugin) is alternative.

Style

  1. avoid using break, continue, return even though you can use them in Scala

  2. avoid using while loop but don't go too crazy

scala.util.Random

It is a wrapper of java.util.Random which is NOT a high quality random number generator.

Argument Parsing

Scala Args Parsing

https://github.com/scopt/scopt

http://blog.plasmaconduit.com/reduve-vs-fold-in-scala/

http://stackoverflow.com/questions/9727637/new-keyword-in-scala

Collections

http://docs.scala-lang.org/overviews/collections/overview.html

http://docs.scala-lang.org/overviews/collections/performance-characteristics.html

http://alvinalexander.com/scala/understanding-scala-collections-hierarchy-cookbook

http://stackoverflow.com/questions/19478244/how-does-a-case-anonymous-function-really-work-in-scala