Void safety
Void safety (also known as null safety) is a guarantee within an object-oriented programming language that no object references will have null or void values.[src] In object-oriented languages, access to objects is achieved through references (or, equivalently, pointers).[src] A typical call is of the form x.f(a, ...) , where f denotes an operation and x denotes a reference to some object.[src] At execution time, however, a reference can be void (or null ).[src] In such cases, the call above will be a void call, leading to a run-time exception, often resulting in abnormal termination of the program.[src] Void safety is a static (compile-time) guarantee that a void call will never arise.[src]
Void safety (also known as null safety) is a guarantee within an object-oriented programming language that no object references will have null or void values.[src] In object-oriented languages, access to objects is achieved through references (or, equivalently, pointers).[src] A typical call is of the form x.f(a, ...) , where f denotes an operation and x denotes a reference to some object.[src] At execution time, however, a reference can be void (or null ).[src] In such cases, the call above will be a void call, leading to a run-time exception, often resulting in abnormal termination of the program.[src] Void safety is a static (compile-time) guarantee that a void call will never arise.[src] ==History== In a 2009 talk, Tony Hoare traced the invention of the null pointer to his design of the ALGOL W language and called it a "mistake": Bertrand Meyer introduced the term "void safety".[src] ==In programming languages== An early attempt to guarantee void safety was the design of the Self programming language.[src] The Eiffel language is void-safe according to its ISO-ECMA standard; the void-safety mechanism is implemented in EiffelStudio starting with version 6.1 and using a modern syntax starting with version 6.4.[src] The Spec# language, a research language from Microsoft Research, has a notion of "non-nullable type" addressing void safety.[src] The F# language, a functional-first language from Microsoft Research running on .NET framework, is void-safe except when interoperating with other .NET languages.[src] ===Null safety based in union types=== Since 2011 several languages support union types and intersection types, which can be used to detect possible null pointers at compiling time, using a special class Null of which the value null is its unique instance.[src] The null safety based in types appeared first in Ceylon, followed soon by TypeScript.[src] The C# language implements compile-time null safety check since version 8.[src] However, to stay compatible with older versions of the language, the feature is opt-in on a per project or per file basis.[src] The Dart language has implemented it since its version 2.0, in August 2018 Other languages that use null-safe types by default include JetBrains' Kotlin, Rust, and Apple's Swift.[src] ==See also== Nullable type Option type Safe navigation operator ==References==[src]
23 sentences · 23 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Void safety." encyclopegia.org, 2026, https://encyclopegia.org/wiki/void-safety. Accessed 25 November 2026.
Chicago
"Void safety." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/void-safety.
APA
encyclopegia.org. (2026). Void safety. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/void-safety
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON