but the preferred practice is to ensure that such exceptions never occur. In Lisp, is a first class object. By convention, (first nil) is , as is (rest nil). So dereferencing in these contexts will not cause an error, but poorly written code can get into an infinite loop. In .NET, access to null reference triggers a to be thrown. Although catching these is generally considered bad practice, this exception type can be caught and handled by the program. In Objective-C, messages may be sent to a nil object (which is a null pointer) without causing the program to be interrupted; the message is simply ignored, and the return value (if any) is nil or 0, depending on the type. Before the introduction of Supervisor Mode Access Prevention (SMAP), a null pointer dereference bug could be exploited by mapping pagezero into the attacker's address space and hence causing the null pointer to point to that region. This could lead to code execution in some cases. Mitigation There are techniques to facilitate debugging null pointer dereferences. Bond et al. suggest to modify the Java Virtual Machine (JVM) in order to keep track of null propagation. Pure functional languages and user code run in many interpreted or virtual-machine languages do not suffer the problem of null pointer dereferencing, since no direct access is provided to pointers and, in the case of pure functional languages, all code and data is immutable. Where a language does provide or utilise pointers which could otherwise become void, it may be possible to mitigate or avoid runtime null dereferences by providing compilation-time checking via static analysis or other techniques, with a burgeoning movement toward syntactic assistance from language features such as those seen in modern versions of the Eiffel programming language, D, and Rust. Similar analysis can be performed using external tools, in some languages. History In 2009, Tony Hoare stated that he invented the null reference in 1965 as part of the ALGOL W language. In that 2009 reference Hoare describes his invention as a "billion-dollar mistake": See also Memory debugger Zero page References Citations Sources Data types