Null Pointer
See also Null References - The Billion Dollar Mistake by Tony Hoare, Tony Hoare, Null (SQL), Null reference, Null pointer, Null pointer exception, Nullable type, Null-Safety, Null-Safety
TLDR: A null pointer is a pointer in programming that does not point to any valid memory location or object. This concept, introduced in early programming languages like C in the 1970s, serves as a way to indicate the absence of a value or reference. However, improper handling of null pointers can lead to null pointer exceptions, causing runtime errors or application crashes.
https://en.wikipedia.org/wiki/Null_pointer
A null pointer is often used as a sentinel value to indicate “no object” or “no data” in scenarios like uninitialized variables or when an object is explicitly set to null. For example, in C, the `NULL` macro is used to represent a null pointer, while in Java or C Sharp, the keyword `null` serves the same purpose. Attempting to dereference a null pointer leads to undefined behavior in C and CPP or throws a runtime exception in managed languages like Java.
https://en.cppreference.com/w/cpp/utility/nullptr
Languages like Kotlin and Swift have addressed the challenges of null pointers by introducing null-safety features. In these languages, nullable and non-nullable types are explicitly defined, and the compiler enforces proper handling of null values. For instance, Kotlin's safe call operator (`?.`) prevents dereferencing nulls, significantly reducing the occurrence of null pointer issues.
https://kotlinlang.org/docs/null-safety.html
To mitigate the risks associated with null pointers, developers use defensive programming practices, such as null checks, default initializations, and static analysis tools like SonarQube or FindBugs. These tools scan codebases to identify potential null pointer exceptions and provide recommendations for safer alternatives, ensuring robust and reliable software systems.
https://www.sonarsource.com/products/sonarqube/
- Snippet from Wikipedia: Null pointer
In computing, a null pointer or null reference is a value saved for indicating that the pointer or reference does not refer to a valid object. Programs routinely use null pointers to represent conditions such as the end of a list of unknown length or the failure to perform some action; this use of null pointers can be compared to nullable types and to the Nothing value in an option type.
A null pointer should not be confused with an uninitialized pointer: a null pointer is guaranteed to compare unequal to any pointer that points to a valid object. However, in general, most languages do not offer such guarantee for uninitialized pointers. It might compare equal to other, valid pointers; or it might compare equal to null pointers. It might do both at different times; or the comparison might be undefined behavior. Also, in languages offering such support, the correct use depends on the individual experience of each developer and linter tools. Even when used properly, null pointers are semantically incomplete, since they do not offer the possibility to express the difference between "not applicable", "not known", and "future" values.
Because a null pointer does not point to a meaningful object, an attempt to access the data stored at that (invalid) memory location may cause a run-time error or immediate program crash. This is the null pointer error. It is one of the most common types of software weaknesses, and Tony Hoare, who introduced the concept, has referred to it as a "billion dollar mistake".
Computer History: Big Tech Silicon Valley Technocracy, Surveillance Valley - The Rise of the Military-Digital Complex - History of the Internet, Facebook (zuck.pdf), Tesla / Space X / Twitter (musk.pdf), History, IT History, Cloud History (Azure History, AWS History, GCP History), Amazon.com / Blue Origin (Bezos - bezos.pdf), Internet History, Email History, Bell Labs, Xerox PARC, OS History (UNIX History - Linux History - Minicomputer - Mainframe History - IBM History - Personal Computer History (Apple I - Apple II - Apple III, IBM PC, Compaq, Macintosh 128K, Apple Lisa), Vintage Apple Resources, Computer Stores, macOS History - Apple History - Apple, Inc. (Steve Jobs jobs.pdf), Windows History - Windows Server History - Microsoft History - Microsoft (Bill Gates gates.pdf, Programming History (C History - C plus plus History | C++ History - C sharp History | History - COBOL History - Golang History - Java History - JavaScript History - Python History - PowerShell History), Computing History, Computing Hardware History, Software Engineering History, Software History, Networking History, Vintage Computing - Vintage Computers - Retrocomputing, Legacy - Defunct Microprocessor Companies (MOS Technology - 6502, Motorola - Motorola 68000, Zilog - Zilog Z80), Legacy - Defunct Computer Companies, Legacy - Defunct Software Companies, History of Computer Hardware, History of Computing, History of Programming Languages, Legacy - Defunct Electronics Companies, PowerPC architecture family, List of PowerPC processors, CPU - Microprocessors, Discontinued Intel processors, 4-bit computing - 4-bit, 8-bit computing - 8-bit, 16-bit computing - 16-bit, 32-bit computing - 32-bit, History of Microsoft Exchange Server (Microsoft Mail - formerly Network Courier), Computer History Museum, Military-Digital Complex - Military-Industrial Complex (Read Surveillance Valley - The Rise of the Military-Digital Complex), Computer History Bibliography, Awesome Retrocomputing, WinWorldPC.com. (navbar_ithistory - see also navbar_bigtech, navbar_technocracy, navbar_programminghistory)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.