Menu

Where null Came From, and Why C# Needed 17 Years to Push Back
📰

Where null Came From, and Why C# Needed 17 Years to Push Back

DEV Community: dotnet·VLAD·about 11 hours ago
#isNEyF7M
#devtodotnet#devto#dev#null#type
Reading 0:00
15s threshold

Object reference not set to an instance of an object. If you write C#, you've read that message more times than you can count. It's a NullReferenceException , and it goes back to a decision one man made in 1965. In 2009 he gave that decision a name: his billion-dollar mistake.

This is the story of where null came from, why it ended up in almost every language you know, and how C# pushed back without breaking existing code. The strange part comes first: the man who added null was trying to make programs safer.

The man who checked everything

Tony Hoare is best known for inventing Quicksort. In his 1980 Turing Award lecture he tells how he started. In August 1960 he became a programmer at Elliott Brothers, a small British computer manufacturer, and was soon asked to design a subset of ALGOL 60 for the company's next machine.

He says the first principle of that design was security. Every correct program should produce either a result or an error message you could understand in terms of your own source code.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.