in reply to Thought for the week, April 8
If you design for 'zero or one', you're building an assumption into the program: "this item can only come in two possible quantities: zero and one." That invites the question, "what happens if your program sees more than one?" to which the usual answer is "it falls over and dies.. possibly trashing the database (or other persistent data) as it goes."
Designing for 'zero, one, or many' means you've covered every possible combination of inputs. It means your code won't fall over because it sees input you didn't plan for.
|
|---|