Skip to main content

Posts

Featured

Null pointer: The villain.

Tony Hoare famously called null references his "billion-dollar mistake" during a presentation at QCon London in 2009. His remarks have inspired many programming languages to devise complex solutions to this problem, such as Option / Maybe types or Result types. While these approaches aim to reduce runtime errors, they often come with trade-offs, such as increased cognitive load and reduced readability. The truth is, null references themselves aren’t inherently flawed. Hoare was simply the first to give a name to the concept of a pointer with a 0 value. If he hadn’t, someone else would have. The real problem lies not in the null value itself but in how it’s used. What's the Problem with Null Pointers? The issue arises when a single value, such as null , is used to multiplex multiple concerns: Legitimate value: A valid pointer to data. Error condition: An indication of failure. Unknown state: Signaling uninitialized or absent data. This overload of responsibilities c...

Latest posts

Why the Ardent compiler?