Nil and None considered Null and Void


Object references in object-oriented languages suffer from their pointer heritage. In this paper we discourage the use of a single magic value, shared among all reference types, to denote a non-referencing state. The advantages of void values, which include uniform treatment of void and non-void data, provision of default-behavior, termination of recursive definitions, and gracefully dealing with error situations are presented in pattern form. We then investigate the impact of the Void Value pattern for language design, extending the applications to implicit creation, abstract method execution, and simplified module usage. Finally we point out related mechanisms like pattern matching in functional programming languages and compare void values to nullcases.

12 pages.

P.S.: A similar pattern has been described by Bobby Woolf and Bruce Andersen under the name Null Object.