Logo

Programming-Idioms

History of Idiom 131 > diff from v30 to v31

Edit summary for version 31 by JWT:
[Csharp] Remove unnecessary underscores

Version 30

2019-09-26, 13:57:45

Version 31

2019-09-26, 13:58:24

Idiom #131 Successive conditions

Execute f1 if condition c1 is true, or else f2 if condition c2 is true, or else f3 if condition c3 is true.
Don't evaluate a condition when a previous condition was true.

Idiom #131 Successive conditions

Execute f1 if condition c1 is true, or else f2 if condition c2 is true, or else f3 if condition c3 is true.
Don't evaluate a condition when a previous condition was true.

Extra Keywords
else switch case
Extra Keywords
else switch case
Code
if (_c1)
{
    _f1();
}
else if (_c2)
{
    _f2();
}
else if (_c3)
{
    _f3();
}
Code
if (c1)
{
    f1();
}
else if (c2)
{
    f2();
}
else if (c3)
{
    f3();
}