Void safety
In object-oriented languages, access to objects is often achieved through references (or, equivalently, pointers). The typical call is of the form
- x.f (a, ...)
where f denotes an operation and x a reference to an object. At execution time, however, a reference can be "void", or "null"; then the above call will be a "void call", leading to a run-time Exception handling, often resulting in a crash.
Void safety is a static (compile-time) guarantee that no void calls will ever arise.
In a 2009 talk [1], Tony Hoare traced the invention null pointer to his design of the Algol W language and called it his "billion-dollar mistake". As early as 1959, however, the Lisp language had the NIL value.
An early attempt to guarantee void safety was the design of the Self programming language.
The Spec# programming language has a notion of "non-nullable type" addressing void safety.
Reference [2] introduced the term "void safety".
References
- ^ C.A.R. Hoare: Null References: The Billion Dollar Mistake, abstract of a talk at QCon London, 9-12 March 2009, available online
- ^ Bertrand Meyer: Attached Types and their Application to Three Open Problems of Object-Oriented Programming, in ECOOP 2005 (Proceedings of European Conference on Object-Oriented Programming, Edinburgh, 25-29 July 2005), ed. Andrew Black, Lecture Notes in Computer Science 3586, Springer Verlag, 2005, pages 1-32, also available online