When coding, say, a registration form from scratch, does it make sense to first start it with the expected inputs, and then go back and capture / process unexpected inputs and deal with errors?
An alternative would be to process the input, check for any constraints and ensure that they are handled properly, and then work with the correct implementation of a typical use case.
One way is preferable to another, and if so, why? Also, is there an alternative way to solve this 2-part problem?
To clarify , in reality, I mean more than just checking data, including business rules, such as “No more than X people can register for this event”
source share