Comment on Keep the JVM, dump the rest ([thoughts on] Scala+Play+MongoDB)parentComments−kikibobo6915yOne nice trick with Option, is how you can replace null checks for common operations. For example, consider the difference between:InputStream i = ...if (i != null) { i.write(...) }vs.val i: Option[InputStream] = ..i.map(_.write(...))Simple, safe, works really well.
Comments
One nice trick with Option, is how you can replace null checks for common operations. For example, consider the difference between:
InputStream i = ...
if (i != null) { i.write(...) }
vs.
val i: Option[InputStream] = ..
i.map(_.write(...))
Simple, safe, works really well.