hi everybody
i've been searching a clean and correct way to use very long if statements.
multiple options:
a switch case statement is in my matter not very useable.
What would be the best way to use, what are the points I should pay attention to? Are there any other options to obtain a fast and clean statement?
Thank you very much for the tips
i've been searching a clean and correct way to use very long if statements.
multiple options:
Code:
if (cond1 && cond2 && (cond3 && cond4) && (cond5 || cond6) {
// do this
}
Code:
if (cond1) {
if (cond2) {
if (cond3 && cond4) {
if (cond5 || cond6) {
// do this
}
}
}
Code:
if ( CheckCondition() ) {
// do this
}
public bool CheckCondition () {
return bool a = cond1;
bool b = cond2;
bool c = (cond3 && cond4);
bool d = (cond5 || cond6);
}
What would be the best way to use, what are the points I should pay attention to? Are there any other options to obtain a fast and clean statement?
Thank you very much for the tips
Comment