Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If the gauntlet condition is something that would prevent the function from succeeding, it returns an error immediately. If the gauntlet condition can be handled, I do so before entering the main body of code whenever possible. I am primarily trying to avoid nested IF statements, which in my experience are one of the primary causes of obscure and hard to debug coding errors.