2 ms·
I stand corrected. Assuming no fallthrough, what are the advantages of this over chaining if and else-if? Just to look cleaner?
by meowface 9y ago
I stand corrected. Assuming no fallthrough, what are the advantages of this over chaining if and else-if? Just to look cleaner?
- consz 9y agoI believe the point is to explicitly take advantage of the fallthrough.
- meowface 9y agoWell, then it would just be chaining if statements.
- tonmoy 9y agoNot much, but I’d say it is more maintainable as well (you can change priority/get rid of the top one without affecting the following lines)