News for hackers. Stuff that matters.
Re:Scala's Option monad versus null-conditional operator in C# by krcz on Saturday February 20, 2016 @05:25PM (#11142261)
Scala version can be written as one-liner as well; losing readability, but it might be ok for fast hacking / prototyping:

article.author.flatMap(_.address).flatMap(_.city).map(_.toLowerCase).foreach(println)

And in for-comprehension version there is no need to use yield, as we don't need result of println.

Re:Scala's Option monad versus null-conditional operator in C# by dk8996 on Saturday February 20, 2016 @06:35PM (#11142494)
We work with Scala at our company and this is the style we use. I think that it's something that even a new person to Scala can easy understand.
Re:Scala's Option monad versus null-conditional operator in C# by Filligree on Saturday February 20, 2016 @07:51PM (#11142759)
Hell, I've never used Scala at all, and I can read that.
Re:Scala's Option monad versus null-conditional operator in C# by closetnerd on Sunday February 21, 2016 @12:37PM (#11145440)
You can tell that "_.author" is a parameterless lambda?
Re:Scala's Option monad versus null-conditional operator in C# by Filligree on Sunday February 21, 2016 @02:19PM (#11146006)
Um, no? It takes one parameter.

Wouldn't fit into the map type signature otherwise.

Re:Scala's Option monad versus null-conditional operator in C# by psuter on Saturday February 20, 2016 @08:28PM (#11142856)
After 10 years of programming in Scala, I must admit I still don't know which style I prefer.