// Multiple level of nesting void func() { if (...) { if (...) { ... } else { if (...) { ... } else if (...) { ... } else { ... } } ... } } // Convert if-else to if-return void func() { if (!test()) { handle_failure(); return false; } // do lots of work } // Multiple return in function not allowed // Convert if-else to success/failure boolean void func() { bool success = section_1(); if (success) { success = section_2(); } if (success) { success = section_3(); } } // Shorter void func() { bool success = section_1(); success = success && section_2(); } // Shorter void func() { bool success = section_1(); success &= section_2(); } // In for-loop, convert if-else to if-continue for(...) { const T& element = *iter; if (!test(element)) continue; ... }