Because functional programming is like algebra, there are no null values or exceptions. But of course you can still have exceptions when you try to access servers that are down or files that are missing, so what can you do? This lesson demonstrates the techniques of functional error handling in Scala.
I just came across a couple more null values out in the wild, this time on the espn.com website.
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 20.5, “Scala best practice: Eliminate null values from your code.”
Tony Hoare, inventor of the
null reference way back in 1965, refers to the creation of the
null value as his “billion dollar mistake.” In keeping with modern best practices, you want to eliminate
null values from your code.
Just one of the possible problems that come with using null values.