Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nesting example
public double RefDoingCalculations()
{
if (!_firstGuard)
{
return 0;
}
if (!_secondGuard)
{
return FirstCalculation();
}
if (!_thirdGuard)
{
return SecondCalculation();
}
return ThirdCalculation();
}
public double DoingCalculations()
{
var result = 0d;
if (_firstGuard)
{
result = FirstCalculation();
if (_secondGuard)
{
result = SecondCalculation();
// 100 LOC ......
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment