A Non-Nullable Value Reduces Complexity by Half

A small thing I realized about programming is that nullable values carry a sneaky amount of complexity in code. Whether or not your programming language forces you to deal with it (like rust), there exists two possible states for every nullable values. If that value interacts with more nullable values, complexity increases exponentially.

Conversely, changing a nullable value in a function’s argument to a non-nullable value has the effect of cutting complexity in half. It’s worth questioning why a function or code path needs a nullable value and if it can be handled elsewhere or removed altogether to save yourself incidental complexity.