News for hackers. Stuff that matters.
Re:Scala: the Case for Correctness by fedesilva on Tuesday October 14, 2014 @10:58PM (#8456988)
You can always use Option() as in:

scala> Option(System.getProperty("kaboom"))

res1: Option[String] = None

then map, getOrElse or fold at will.

(edited format)

Re:Scala: the Case for Correctness by joegaudet on Tuesday October 14, 2014 @11:35PM (#8457056)
For sure you can, but the internals of the libraries can also cause NPEs because of turtles all the way down :P

We've been running scala in production for 4 years, and had our share of NPEs in our code and in the libraries we host. My point I guess was just that it's not entirely true that they will not boil to the surface on occasion.

Re:Scala: the Case for Correctness by fedesilva on Wednesday October 15, 2014 @09:35PM (#8462834)
It's true what you say about libraries and turtles. Still it's rare the event when I get an NPE from my/our code.

Sometimes think I would love to have a layer between us and Java. Some sort of FFI which returned everything on an Option.

Probably too cumbersome, but still ...

Re:Scala: the Case for Correctness by saosebastiao on Tuesday October 14, 2014 @11:22PM (#8457035)
Thanks for mentioning this. I had no idea. All this time I had been doing null checks...this makes it so much less painful!