3 ms·
The Null Object[1] is a useful thing. It can represent the behavior when there's no correct behavior. It exists in languages like SmallTalk as well as LISP and
by cratermoon 4y ago
The Null Object[1] is a useful thing. It can represent the behavior when there's no correct behavior. It exists in languages like SmallTalk as well as LISP and LISP-derived languages.
In Go, you can call methods on nil objects. [2]
1 https://wiki.c2.com/?NullObject https://wiki.c2.com/?NullObject
2 https://go.dev/play/p/mgayNTjdacL https://go.dev/play/p/mgayNTjdacL