Avoid a Void: The Eradication of Null Dereferencing

All object-oriented programs, but also those in C or Pascal as soon as they use pointers, are subject to the risk of run-time crash due to “null pointer dereferencing”. Until recently this was the case even in statically typed languages. Tony Hoare has called this problem his “billion-dollar mistake”. In the type system of ISO-standard Eiffel, the risk no longer exists: void safety (the absence of null pointer dereferencing) has become a property guaranteed by the type system and enforced by the compiler. The mechanism is fully implemented and major libraries and applications have been made void-safe. This presentation describes the principles of Eiffel’s void safety, their implementation and the lessons gained.