Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 664 Bytes

billion-dollar-mistake.md

File metadata and controls

9 lines (5 loc) · 664 Bytes

Billion Dollar Mistake

The presence of null and its assignability to any type makes programs error-prone. Since any variable can be "null", we never know when we may want to call e.g. some method on null instead of the real object.

Null object pattern mail lead to silent errors. It may be also tedious in maintenance, because we have to update it often when original class changes. It would be helpful when we really want to apply default behavior for some cases.

Option types are awesome, because they are completely safe. However, they might create some overhead with a lot of additional code.