2 ms·
> It was hammered into my when I first learned that you should only ever have one exit in your code, anything else is bad practice. Yes. This rule was an over
by JohnFen 4y ago
> It was hammered into my when I first learned that you should only ever have one exit in your code, anything else is bad practice.
Yes. This rule was an overreaction to a pervasive problem back in the day.
But, much like the use of "goto"s, there are times where your code is more readable, maintainable, and efficient if you ignore the prohibition. The trick is to know when that's the case.