Although my examples are made using PHP, this tip may be applied to many scripting languages. I entitled it as "return as soon as possible"™ and became quite popular when I posted it on my blog. It may be summarized as transforming: if ($conditionToPerform) { perform(); } else { return false; } to: if (!$conditionToPerform) { return false; } perform(); The benefit of writing code this way may not be obvious, but take a closer look at the next implementatio...