Twitter: The Great Migration, the Winter of 2011
engineering.twitter.com3 pointsby cachemoney0 comments
def x2or0(i: Option[Int]): Int = i.getOrElse(0) * 2
def x2(i: Option[Int]): Option[Int] = i.map(_ * 2)
def x2danger(iOrPossiblyNull: Int) = i * 2
// throws NullPointerException on null input