Single return versus multiple return

Imagine the maitre d’ at a restaurant. When a diner enters the restaurant the maitre d’ has to perform a number of checks to determine whether the diner is allowed a table. When we take this real world scenario and convert it into code, we end up writing a validation function. If the rules are: Check the diner is old enough Check the booking exists Check the booking has not expired Check there is a table available Then we can write the code as follows: [Read More]