Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

nothing wrong with switch statements.


Coerced-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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: