随便看看https://github.com/alexandru/scala-best-practices/
以下是我觉得讲得有意义的。
1. avoid using "return" in nested function.
2. avoid using mutable variables in most scenario unless you know that will only be using in single actor/thread.
3. avoid using exception for validation user input, the exception should only indicate the error.
4. avoid using "null", always using Option instead.
5. never use Option.get, this will throw the NoSuchElementException, using getOrElse or fold instead.
6. Use joda-time instead of java Date.
7 avoid using Any or AnyRef or isInstanceOf or asInstanceOf
8. no shared state, if really need it, we might can use Scala-STM for optimistic concurrency control / atomic reference.
9 case class should not nested in other class, otherwise ,the case class with serialize the whole class into it.
10. profiling with YourKit profiler, or VisualVM is also good enough.
11. must use scala blokingcontext on blocking I/O.
12. we can also use Scala-aync for better Await.result style.
13. should use a separate thread pool for blocking I/O such as JDBC operation.
14 avoid hardcode the thread pool or the execution context.
15 should mutable state in actors only with context.become.