Permalink

A plan for NullPointerExceptions

17 AUG 2004

Dion reports on Eric Gunnerson's receipt of an email posing the problem:

When I'm writing code, I often come across a situation where my code throws an exception because another component called with a null parameter. I'd like a way to prevent that from happening.

Apparently, all sorts of weird and wonderful solutions have been proposed. Dion just wants careful error reporting, and that's fine. How about plan B?

Plan B

Use a language like Nice, which prevents NullPointerExceptions altogether. I'd love to have a .Net backend for Nice, so if C# people have a burning desire to solve the NullPointer problem, we'd welcome their help with porting Nice to run on .Net.