Apparently the vast majority of errors in code are null reference exceptions. Are there any general techniques to avoid encountering null reference errors?
Unless I
One way is to use the Null Value Objects (aka the Null Object Pattern) where possible. There are more details here