4 ms·
for some reason (probably a bad one) i love switch statements and i look forward to the match expression
by kyleee 6y ago
for some reason (probably a bad one) i love switch statements and i look forward to the match expression
- systematical 6y agonothing wrong with switch statements.
- zowanet 6y agoCoerced-typed (weak) comparisons and easy accidental fallthrough are the problems commonly associated with switch statements. The new match construct fixes both of these and is also an expression instead of a statement, allowing for more expressive code.
- __sisyphus__ 6y agofor whatever reason (also probably a bad one), i hate the syntax of switch statements, and for that reason i almost never use them. the match expression though, i'm actually very excited about. i quite like the mapped look; it seems more intuitive to read.