"Tony Hoare introduced Null references in ALGOL W back in 1965 “simply because it was so easy to implement”, says Mr. Hoare. He talks about that decision considering it “my billion-dollar mistake”."
Sir Charles Antony Richard Hoare, commonly known as Tony Hoare, is a British computer scientist, probably best known for the development in 1960, at age 26, of Quicksort.
He currently works in Microsoft.
interface IAnimal { void MakeSound(); }
class NullAnimal : IAnimal { public void MakeSound() { // Purposefully provides no behaviour. } }...
IAnimal unknown = new NullAnimal(); //instead of: unknown = null; unknown.MakeSound(); // outputs nothing, but does not throw a runtime exception
No comments:
Post a Comment