Scala's standard library provides very helpful information on how to replace null with its Maybe class (called Option in Scala). Just take a peek into their collections library[4], and search for Option.
[1] http://www.infoq.com/presentations/Null-References-The-Billi...
[2] http://moonbase.rydia.net/mental/writings/programming/monads...
[3] http://andand.rubyforge.org/
[4] http://www.scala-lang.org/api/current/scala/collection/immut...
Do you have a source for this? I was under the impression nil was directly taken from Smalltalk, which derived it from Lisp.
The null reference was invented by C.A.R. Hoare in 1965 as part of the Algol W language. Hoare later (2009) described his invention as a "billion-dollar mistake":[10][11]
[1] http://en.wikipedia.org/wiki/Null_pointer#Null_pointer
Where:
[10] http://qconlondon.com/london-2009/presentation/Null+Referenc...
[11] http://www.infoq.com/presentations/Null-References-The-Billi...
Yes, the same video I linked above.
I prefer that functions throw an exception when unable to do what they promised, rather than return nil or a null object. The try-catch block serves as documentation that the function might fail. If someone forgets to catch the exception, it will shut everything down rather than leave the program in an unanticipated state that could lead to an error elsewhere.