Simplify Early

Complexity derived from data should be eliminated as soon as possible. If a routine expects an array as input, a null value should be converted to an empty array as soon as possible, protecting later code from the Novel Scenario [[NovelScenario]] of a null value. This only works if the null value does NOT convey meaningful Information relative to an empty array. Null and an empty array might have different Null Flavors.

This tactic is a compliment to [[ComplicateLate]] Complicate Late. A Guard Clause [[GuardClause]] is an example of Simplify Early. This could be considered Defencive Programming.

#software #complexity