Having only One Return statement is Better and More Safe
Functions in programming languages are incredibly useful: They are designed to take input parameters, do something with them, and output a result. This conforms to the well-known IPO model (Input, Process, Output). However some developers tend to interrupt that process, making it harder to follow and thus understand a function, and risking evil and nasty bugs.
Let's see why not always all roads lead to Rome.
Continue reading...