avoiding null reference exceptions

后端 未结 15 1045
天命终不由人
天命终不由人 2020-11-28 08:50

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

15条回答
  •  广开言路
    2020-11-28 09:23

    One way is to use the Null Value Objects (aka the Null Object Pattern) where possible. There are more details here

提交回复
热议问题