Back in the day when I was learning programming theory at the university, I was always told that it was bad practice, taboo if you will, to have more than one exit point for a function.
As I have programmed more an more in the real world, I have come to the conclusion that not only is this not always the case, but in many instances it has made my code much more legible by placing exit conditions at the top. This reducing the amount of "arrow" code I write.
I have heard that a lot of this argument comes from C where you would run into memory leak bugs because you would forget to clean up at those exit points.
The other explanation I have heard for this commonly taught practice is that if I have to have more than one exit point, my functions are too long. I completely disagree with this argument.
Do you support the argument that all functions should only have one exit point, or do you think it's OK and in some cases good to have multiple return points?
Duplicate of Should a function have only one return statement ? which has already some other duplicates like Single return or multiple return statements? [closed], Are multiple return points from a method good or bad? (mmm, not closed), and so on. Already a number of answers to study -- PhiLho