3 ms·
And, to illustrate my point, hypothetical "if statement is also conditional expression" syntax, to illustate how much more readable "ifs" are than "?:": myva
by Pxtl 6y ago
And, to illustrate my point, hypothetical "if statement is also conditional expression" syntax, to illustate how much more readable "ifs" are than "?:":
myvar = if(condition_1) {value_1}
else if(condition_2) {value_2}
else if(condition_3) {value_3}
else {value_fallback};
- RHSeeger 6y agoWhile I agree that "if statements are expressions" is a nice feature, I disagree that your version is more readable. That being said, it's readable enough that, if the rest of my team preferred it, I'd be ok using it.