K
Kaz Kylheku
not according to the OO people. The NullClass is a recognised design pattern.
The claim is it simplifies things!
The blog rant is about null references.
A null object with a null class (like the nil object in Common Lisp, which is
of class null) is a different beast from null references. Null references are
invalid values of their respective reference types: null reference to a String,
null reference to a Stream, etc.
This means that just because your method takes a string class doesn't mean
you're out of the woods; that argument may still be null.
In a OO language with a real nil, that wouldn't be the case: a method argument
for a string class would never receive a nil argument.
(defmethod foo ((obj null))
(write-line "null version of foo called"))
(defmethod foo ((obj string))
(write-line "string version of foo called"))
(foo nil)
null version of foo called
(foo "abc")
string version of foo called
The blog author calls for the abolishment of null references from high level
languages. Evidently, he has never used one.