, , , . , , , 4 . #, Python. # vs Python, if, MANY . StyleCop . StyleCop, FxCop, ReSharper - . return? , return - , else if, " " ( switch), :
{
if (res == ResultType.Failure)
{
return ProcessFailure(..);
}
if (res == ResultType.ScheduledAndMonitored)
{
bool result = DoSomething(...);
result = result && DoSomething3(..);
return result;
}
if (res == ResultType.MoreInfoAvailable)
{
info = GetInfo(..);
}
if (res == ResultType.OK && someCondition)
{
return DoSomething2(..);
}
Debug.Assert(false, "Why did we get here? Explanation: ");
}
, , , . - . . , . , StyleCop , , , , / ..
, , .