Stuart A. answered 08/27/26
Programmer with over 15 years of experience with the C++ language.
you do not need to keep nesting try this pattern:
bool conditionA = executeStepA();
bool conditionB = false;
bool conditionC = false;
...
bool conditionXXX = false
...
bool conditionLast = false;
if (conditionA)
{
conditionB = executeStepB();
}
if (conditionB)
{
conditionC = executeStepC();
}
... repeat above pattern like this:
if (conditionX)
{
conditionXX = executeStepXX();
}
...
executeThisFunctionInAnyCase();